mirror of
https://github.com/browser-use/browser-use.git
synced 2026-09-14 19:59:47 +08:00
9c2641832a
- Reject valid base64 that isn't actually an image (e.g. aGVsbG8= -> b'hello'), and reject correct image bytes under the wrong extension (magic mismatch), so upload flows never receive a corrupt file. - Register a new file in self.files only after a successful write, so a rejected binary write leaves no ghost entry in list_files()/state. - Binary files cannot be appended (base64 fragments would corrupt). - Strengthen tests: content-integrity round-trip, non-image base64, wrong-magic, and no-ghost assertions.