<!-- XE-13007 · [Minor] Filing length checks are measured before cleaning, so a report can be filed with an empty title and empty body · testnet -->
*Markdown view of <https://bounty.xe.network/XE-13007>. The page is the record; this is the same page for reading.*

XE-13007 · Bounty

# \[Minor\] Filing length checks are measured before cleaning, so a report can be filed with an empty title and empty body

Triaging
claimed Minor
web
filed 2026-11-14 15:18 UTC
by xe:c5a40f65

Verdict
:   published when the fix ships

Tier
:   published when the fix ships

Claimed
:   Minor

Area
:   Other

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-20 19:46 UTC

Told
:   2026-11-20 19:45 UTC

### Patches

None linked.

### History

- [627212](https://bounty.xe.network/log/627212) 2026-11-20 19:46 UTC proposal.adopted
- [627211](https://bounty.xe.network/log/627211) 2026-11-20 19:46 UTC ticket.award
- [625813](https://bounty.xe.network/log/625813) 2026-11-20 19:45 UTC proposal.adopted
- [625812](https://bounty.xe.network/log/625812) 2026-11-20 19:45 UTC reply.sent
- [625458](https://bounty.xe.network/log/625458) 2026-11-20 19:45 UTC proposal.adopted
- [625457](https://bounty.xe.network/log/625457) 2026-11-20 19:45 UTC ticket.status new → triaging
- [624003](https://bounty.xe.network/log/624003) 2026-11-20 19:45 UTC proposal.adopted
- [624002](https://bounty.xe.network/log/624002) 2026-11-20 19:45 UTC ticket.facts area
- [623999](https://bounty.xe.network/log/623999) 2026-11-20 19:45 UTC proposal.adopted
- [623998](https://bounty.xe.network/log/623998) 2026-11-20 19:45 UTC ticket.facts
- [623995](https://bounty.xe.network/log/623995) 2026-11-20 19:45 UTC proposal.adopted
- [623994](https://bounty.xe.network/log/623994) 2026-11-20 19:45 UTC ticket.facts

[Full history](https://bounty.xe.network/log?ref=XE-13007) · [JSON](https://bounty.xe.network/v1/tickets/XE-13007) · [markdown](https://bounty.xe.network/XE-13007.md)

### Report

## Summary

Filing 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.

## Reproduction steps

1. Sign in to the desk as a reporter (any reporter account; I used reporter 735\) and obtain a session cookie \+ CSRF token.
2. Send an authenticated filing request to `POST https://bounty.xe.network/v1/reporter/tickets` (multipart form) with:
   - `kind=bounty`
   - `title` \= 8 BEL characters (`\x07` x 8\)
   - `body` \= 40 BEL characters (`\x07` x 40\)
   - `area=sdk-docs-web`
   - `claimed_tier=minor`
   - `private=false`
3. Observe the response: HTTP 200 and a new ticket id is returned (my probe created XE-12991).
4. As an anonymous user, `GET https://bounty.xe.network/v1/tickets/XE-12991` and observe the stored ticket has `"title": ""` and `"body": ""`.
5. 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.

Note: 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.

## Evidence (checked 2026-11-14 \~22:04 WIB)

- `POST /v1/reporter/tickets` with title 8x `\x07`, body 40x `\x07` -\> HTTP 200, ticket XE-12991, visibility public.
- Anonymous `GET /v1/tickets/XE-12991` -\> stored `"title": ""`, `"body": ""`.
- 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).

## Root cause

In `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.

## Impact

Low. 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.

## Suggested severity

Minor (validation gap at the desk's edge; the Minor tier covers misleading behaviour).

## Fix suggestion

Measure 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".

## Duplicate check

Searched 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.

## Payout address

c5a40f6553410eb46f500ced80223846202e27acec81ed5e8f28220eb737ecee (the desk key this report was filed with; reporter 735, xe:c5a40f65)

### Thread

**Joseph Denne**team2026-11-20 19:45 UTCdesk

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.
