Harden image ingress: magic bytes, re-encode, limits, metadata stripping, and rate control #16
Closed
opened 2026-08-19 01:58:59 +00:00 by timmy
·
3 comments
No Branch/Tag Specified
main
timmy/19-metrics-operator-report
timmy/16-image-ingress-hardening
timmy/40-security-rc-evidence
timmy/27-dataset-card
timmy/26-review-adjudication
timmy/32-abstention-policy
timmy/29-evaluation-harness
timmy/35-portable-backup-versions
timmy/24-training-contribution-consent
fix/demo-caption-pixels
timmy/36-photo-lifecycle-controls
timmy/release-notes-grounded-chat
timmy/37-grounded-chat-citations
timmy/21-escalation-regression
timmy/34-explainable-pattern-summaries
timmy/15-container-worker-receipts
timmy/73-blank-first-ordering
timmy/18-vision-corpus
timmy/20-photo-dataflow-threat-model
timmy/67-hard-stool-followup
timmy/13-provisional-suggestion-state
timmy/12-manual-fallback-draft-recovery
timmy/11-mobile-capture-recovery
free/hy3-timmy-16
timmy/35-version-ledger-migrations
timmy/41-release-observability-dashboard
free/step-timmy-14
timmy/21-escalation-regression-suite
timmy/17-bounded-inference-queue
timmy/58-strict-csp-runtime-config
timmy/55-staging-deployment-tooling
timmy/53-private-subpage-staging
timmy/10-reproducible-smolvlm-bootstrap
timmy/48-vomiting-phrase-hotfix
timmy/48-server-safety-override
timmy/47-sleek-hermes-agent
timmy/9-product-boundary-decisions
timmy/8-ci-gates
daily-2026-11-02
daily-2026-11-01
daily-2026-10-31
daily-2026-10-30
daily-2026-10-29
daily-2026-10-28
daily-2026-10-27
daily-2026-10-26
daily-2026-10-25
daily-2026-10-24
daily-2026-10-22
daily-2026-10-21
daily-2026-10-20
daily-2026-10-19
daily-2026-10-18
daily-2026-10-17
daily-2026-10-16
daily-2026-10-15
daily-2026-10-14
daily-2026-10-13
daily-2026-10-12
daily-2026-10-11
daily-2026-10-10
daily-2026-10-09
daily-2026-10-08
daily-2026-10-07
daily-2026-08-27
daily-2026-08-26
daily-2026-08-25
daily-2026-08-24
daily-2026-08-23
daily-2026-08-22
daily-2026-08-21.1
daily-2026-08-21
daily-2026-08-20.3
daily-2026-08-20.2
daily-2026-08-20.1
daily-2026-08-20
daily-2026-08-19.2
daily-2026-08-19.1
daily-2026-08-19
Labels
Clear labels
area/backend
area/data
area/frontend
area/model
area/privacy
area/release
area/safety
blocked
human-gate
priority/P0
priority/P1
priority/P2
state:review
type/docs
type/epic
type/feature
type/ops
type/research
type/security
type/test
Application API and storage
Dataset and provenance
PWA and interaction design
Vision model and inference
Privacy and consent
Release engineering and distribution
Clinical safety boundary
Blocked on an explicit dependency or decision
Requires explicit human approval
Release-critical
High priority
Planned
Documentation and evidence
Roadmap epic
Product feature
Infrastructure and operations
Research or evaluation
Security hardening
Verification and quality gate
Milestone
No items
No Milestone
M1 — Sovereign Photo Intelligence
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: stackchain/timmy-talking-turd#16
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Parent epic: #2
Outcome
Treat every uploaded medical image as hostile and sensitive.
Acceptance criteria
Dependencies
Required evidence
Delivery
Open a focused branch and PR with
Closes #ISSUE. Do not include real medical images in issue comments or Git history.[CLAIM] agent=timmy
Working in dedicated worktree /tmp/hy3-timmy-16 at origin/main
47294a9on branch free/hy3-timmy-16. Scope: magic-byte validation, safe re-encode with metadata stripping, strict body/dimension/time limits, and bounded rate control on the /api/analyze image ingress. Strict RED-GREEN TDD with hostile synthetic fixtures (spoofed MIME, polyglots, truncation, decompression bombs, EXIF/GPS, oversized dimensions, bursts). Fail closed with sanitized errors and manual fallback; no real medical images, no live deploy.[EVIDENCE] agent=timmy
PR: #63 (branch free/hy3-timmy-16 at
ccb2279, base47294a9). Not merged; awaiting human review.PR #82 is open against main with
Closes #16— a fresh implementation of these acceptance criteria on today’s tree. It supersedes PR #63 (branchfree/hy3-timmy-16), which has six conflicts and 31 commits of drift since it was written.Verified locally: 225 unit/security tests pass; the new acceptance suite runs the shipping server against synthetic bytes with a counting provider stub and shows non-image, polyglot, oversized-dimension, flood (429 + Retry-After) and stalled-body (408) refusals all landing before any provider call, with a clean re-encoded photo still reaching it exactly once; the browser suite shows the new upload-free refusal state and proves nothing was posted. Release demo re-recorded: 63/63 captions measured as painted, including the refusal scene, and the builder now requires it.
Not merged — review and RC approval stay with the release job. The threat model now names each control and its enforcing test.