Files
romm/backend/endpoints/sync
Georges-Antoine Assi d1cd58e6b9 fix: bound PSP container decoding, atomic reset tokens, cap sync play sessions, redact log tokens (#5809)
* fix(psp): bound what a compressed PSP container header can make us decode

The CISO/ZISO block size, the index length and ISO9660 directory sizes
all come from the uploaded file. Cap the block size at 1 MiB, require the
index table to fit in the file, refuse out-of-order index entries, cap
deflate output at the block size, and cap directory reads at 1 MiB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: cap sync play sessions in the schema and redact token values in logs

The sync completion payload now declares max_length on play_sessions,
so an oversized list is refused while it is validated instead of after
every entry is parsed. It answers 422 like any other invalid payload.

token is added to the redacted log keys, so a reset link or any other
token=... query value is masked in the log viewer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(auth): redeem a password reset token with one atomic GETDEL

The reset JTI was checked with EXISTS and then removed with DELETE, so
two requests on different workers could both pass the check. Use GETDEL,
as invite and refresh tokens already do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(psp): reject a deflate block that ends before its output cap

Addresses Greptile review on #5809: a truncated CISO/DAX block now raises
zlib.error again instead of hashing a partial EBOOT.BIN, so the scan falls
back to RAHasher. Adds tests for truncated streams and out-of-order index
entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 09:56:06 -05:00
..