fix(chat): fail closed when attachment MIME sniff sees invalid UTF-8 binary
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- Avg merge
- 1h 7m
- Merged PRs (30d)
- 969
Description
Post-merge forensic from PR #961 exact head 1115421a85e19420a1fdc6a03c3fc6797dd994de. attachment-mime-sniff.ts currently treats arbitrary no-NUL bytes as text. Counterexample bytes 255,254,253,252,251,250 are classified as family=text and acceptedAsText=true. Required fix: validate UTF-8/text semantics and fail closed for binary payloads, with mutation/negative tests. One issue, one PR. Related governance incident: #956. Coordination state: recorded but not dispatched because it is not in the current pnpm harness readiness queue.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in attachment-mime-sniff.ts and reproduce the counterexample with bytes 255, 254, 253, 252, 251, and 250. Validate UTF-8/text semantics so invalid binary payloads fail closed, then add mutation and negative tests showing they are not accepted as text.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100