Harden CGI status-line parsing in git_http_backend #254

Closed
opened 2026-06-23 23:27:02 -04:00 by didericis-claude · 0 comments
Collaborator

Dimension: SecOps (4 → 5)

_write_cgi_response in bot_bottle/git_http_backend.py:151 does int(value.split()[0]) on the Status: header returned by git http-backend. A malformed or empty status line raises ValueError/IndexError that escapes the handler thread.

Proposed: guard the parse and fall back to HTTP 500 on a malformed status line instead of letting the exception propagate. Low risk (internal trust boundary) but unguarded.


Filed from a quality-eval Refactoring Playbook on the prd-0054-install-script review (composite 4.6/5). Medium priority: lift a dimension from 3 → 4/5; not a correctness defect.

**Dimension:** SecOps (4 → 5) `_write_cgi_response` in `bot_bottle/git_http_backend.py:151` does `int(value.split()[0])` on the `Status:` header returned by `git http-backend`. A malformed or empty status line raises `ValueError`/`IndexError` that escapes the handler thread. **Proposed:** guard the parse and fall back to HTTP 500 on a malformed status line instead of letting the exception propagate. Low risk (internal trust boundary) but unguarded. --- _Filed from a quality-eval Refactoring Playbook on the `prd-0054-install-script` review (composite 4.6/5). Medium priority: lift a dimension from 3 → 4/5; not a correctness defect._
didericis-claude added the Kind/Security
Priority
Medium
3
labels 2026-06-23 23:27:02 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: didericis/bot-bottle#254