mirror of
https://github.com/kevinveenbirkenbach/homepage.veen.world.git
synced 2026-09-10 21:26:48 +00:00
catalog() joined the requested language code straight into the UI and content catalogue paths, and read_catalog logged those paths. Both the negotiated Accept-Language code and the /<lang>/ route only ever pass supported codes, but that guarantee lived in the callers, so CodeQL reported path injection and log injection on the request value. catalog() now resolves the code through a table of the supported languages and builds the file names from the table's value, so an unsupported code returns an empty catalogue and never becomes a path. A unit test holds "../content/de" to that without reading any file, and the translate_tree fixture moves from the made-up code "xx" to "de" because unsupported codes now translate to English by design. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>