mirror of
https://github.com/rommapp/romm.git
synced 2026-11-30 02:22:44 +01:00
Security review follow-ups on the Demozoo, Pouet, and CSDb handlers. Default the three sources to off, matching every other provider. They were the only ones defaulting to on, so an upgrade began contacting demozoo.org, pouet.net, and csdb.dk on the next scan with no operator opt-in, reachable through the unauthenticated metadata heartbeat. Guard the bare id conversion in scene_id_or_none. str.isdigit() accepts superscripts and other digits int() rejects, so a pasted "²" raised out of the Edit ROM endpoint as a 500. Filter the remote demozoo_url through http_url(). It was the only one of the three URL fields taking a string from the API rather than building one from a hardcoded template and an integer id. Match a YouTube id against an explicit ASCII class. isalnum() is Unicode-aware, so it accepted ids the embed URL never can. Stream the CSDb response against a byte budget. The cap ran after the whole body was already buffered, so it bounded the parse but not memory. Catch defusedxml's refusals. EntitiesForbidden derives from ValueError and ParseError from SyntaxError, so the existing handler caught neither and an entity-declaring document raised out of production_from_xml. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>