You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A max-effort self-review of the Trust Center surfaced several issues, fixed here:
- Stored XSS via custom CSS: clean_css() did a single regex pass, defeated by
split-token recreation (e.g. `</sty</stylele>` -> `</style>`). Custom CSS is
now served from a dedicated text/css endpoint (/trust/custom.css) via <link>,
so there is no HTML context to break out of; clean_css() also iterates to a
fixed point as defence in depth. Drops the now-unused safe_css template filter.
- HTTP 500 on the public request endpoint: the client-controlled X-Forwarded-For
was stored into a GenericIPAddressField unvalidated, crashing on the Postgres
inet column. _client_ip() now validates via ipaddress and returns None on bad
input.
- Content-Disposition header injection: the download filename was interpolated
unescaped; a double quote broke the header and CRLF caused a 500. Both public
and gated downloads now use a sanitized, RFC 5987-encoded disposition.
- Gated link outliving takedown: the gated download re-checks the document is
still published(), so unpublishing/archiving revokes outstanding approved links.
- Approval now warns when the download-link email could not be sent instead of
always reporting success.
- Removes the unused "trust_request" throttle rate and its misleading comment.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments