Files
dtf-system/app/scanning.py
Cauê Faleiros 7e33e6fb1d
All checks were successful
Build and deploy / Validate source (push) Successful in 8s
Build and deploy / Integration suite on a real stack (push) Successful in 8m38s
Build and deploy / Secret scan and release gate (push) Successful in 7s
Build and deploy / Publish images (push) Successful in 1m19s
fix: a hostile PDF cannot hold the scanner: bounded DPI reading and a stuck scan is reported
The DPI of a stored PDF is read in a subprocess killed after
PDF_MAX_SECONDS + 5; inside it, only image draws count toward
PDF_MAX_DRAWS (heavy vector art still reads), content streams are parsed
once per object, and the deadline is checked every 1000 operators. A scan
busy for more than SCAN_STUCK_SECONDS marks the scanner unhealthy and logs
one error to Sentry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 10:50:14 -03:00

7.9 KiB