{"id":"XE-13007","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":735,"title":"[Minor] Filing length checks are measured before cleaning, so a report can be filed with an empty title and empty body","area":"other","claimed_tier":"minor","assessed_tier":null,"verdict":null,"duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":null,"status":"triaging","closed_reason":null,"github_state":"","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-14T15:18:45.743086+00:00","updated_at":"2026-11-20T19:46:43.816800+00:00","source_created_at":null,"told_at":"2026-11-20T19:45:48.474392+00:00","status_changed_at":"2026-11-20T19:45:44.103807+00:00","url":"https://bounty.xe.network/XE-13007","body":"## Summary\r\nFiling length checks are measured BEFORE cleaning, so a report can be filed with an empty title and an empty body: a title of 8 control characters and a body of 40 control characters pass the 8/40 minima, but both are stored empty.\r\n\r\n## Reproduction steps\r\n1. Sign in to the desk as a reporter (any reporter account; I used reporter 735) and obtain a session cookie + CSRF token.\r\n2. Send an authenticated filing request to `POST https://bounty.xe.network/v1/reporter/tickets` (multipart form) with:\r\n   - `kind=bounty`\r\n   - `title` = 8 BEL characters (`\\x07` x 8)\r\n   - `body` = 40 BEL characters (`\\x07` x 40)\r\n   - `area=sdk-docs-web`\r\n   - `claimed_tier=minor`\r\n   - `private=false`\r\n3. Observe the response: HTTP 200 and a new ticket id is returned (my probe created XE-12991).\r\n4. As an anonymous user, `GET https://bounty.xe.network/v1/tickets/XE-12991` and observe the stored ticket has `\"title\": \"\"` and `\"body\": \"\"`.\r\n5. The same defeat works with mixed input: a title of \"ab\" + 6 control characters passes the 8-character check but is stored as 2 characters.\r\n\r\nNote: XE-12991 was a clearly-labelled probe filed only to demonstrate this behaviour; I withdrew it immediately afterwards (status closed/withdrawn), so no probe ticket is left live.\r\n\r\n## Evidence (checked 2026-11-14 ~22:04 WIB)\r\n- `POST /v1/reporter/tickets` with title 8x `\\x07`, body 40x `\\x07` -> HTTP 200, ticket XE-12991, visibility public.\r\n- Anonymous `GET /v1/tickets/XE-12991` -> stored `\"title\": \"\"`, `\"body\": \"\"`.\r\n- The multipart filing route has no boundary check for these bytes: the JSON `auth.Body` check (NUL -> 422) does not apply to `Form(...)` parameters, and no \"NoNul\" middleware exists anywhere in the repo (grep: zero hits).\r\n\r\n## Root cause\r\nIn `desk/services/reporters.py:451-462` (origin/main), `file_ticket` strips whitespace and then length-checks the title (8..200) and body (40..60000) on the RAW value. `tsvc.create()` (`desk/services/tickets.py:231-253`) then stores `clean_text(title, one_line=True)[:512]` and `set_body(clean_text(body))`, where `clean_text` (`tickets.py:87-98`) strips NUL and control characters via `_CONTROL = re.compile(r\"[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]\")` (plus lone surrogates). `\\x07` is inside `\\x00-\\x08`, so it is stripped after the length gate has already passed. The stated minima are therefore measured on input that is then thrown away — the stored ticket violates the rule the check claims to enforce.\r\n\r\n## Impact\r\nLow. No data leak and no privilege issue. The cost is queue pollution: empty-title / empty-body tickets land in the public list and the triage queue, and the length rules the desk advertises (\"give the report a title of at least eight characters\", \"say more ... 40 characters at least\") can be defeated entirely. Same silent-mishandling class as XE-3116 / XE-3342 / XE-12962, different field and different mechanism.\r\n\r\n## Suggested severity\r\nMinor (validation gap at the desk's edge; the Minor tier covers misleading behaviour).\r\n\r\n## Fix suggestion\r\nMeasure the length AFTER `clean_text` in `file_ticket`: clean first, then check 8/40 on the cleaned value. One-line rule fix, same pattern as XE-12962's \"validate the stored value, not the raw input\".\r\n\r\n## Duplicate check\r\nSearched the desk before filing (2026-11-14): XE-11963 (clean_text lets bidi/invisible chars THROUGH — the opposite direction), XE-8558 (control bytes in a wallet memo, SDK surface), XE-10097 (`reply_draft` has NO length cap at all), XE-9659 / XE-9597 / XE-3534 (hex whitespace spellings). None covers length being checked before cleaning on filing intake. No existing ticket covers filing an empty title/body this way.\r\n\r\n## Payout address\r\nc5a40f6553410eb46f500ced80223846202e27acec81ed5e8f28220eb737ecee (the desk key this report was filed with; reporter 735, xe:c5a40f65)","patch_refs":[],"thread":[{"id":15172,"source":"desk","source_ref":"reply:13063","author":"Joseph Denne","team":true,"body":"Thank you for this report. We have read it against the current tree and it is being handled. The assessment and any award follow the fix.","created_at":"2026-11-20T19:45:48.448541+00:00"}]}