Repository navigation
docs: the recipe for decoding in a box - #10
Merged
Merged
Conversation
Stage 4 of brief 022: what to do about a flaw in the reader you allow, which the check cannot know about. Two files, a parent and a worker: the check first, then the decode in a fresh process that has set its own memory, processor, output and core-dump limits, with a wall-clock limit and a scrubbed environment from outside, and a sentence back for whatever ends it. Run on Linux in a container before writing up: a 445 KB PNG that decodes to 432 MB failed inside a 512 MiB box in a tenth of a second, and a real scan decoded under the same box. The page says what systemd-run, bubblewrap and a container add, what macOS does not enforce, and what the box is not. The README's "what it does not do" now points at it instead of promising it. Co-authored-by: Yvette Mankerian <yvettekm@gmail.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RLIMIT_AS,RLIMIT_CPU,RLIMIT_FSIZEand no core dump on itself, opens with only the allowed readers, decodes, and writes a PNG of its own making. A dead worker becomes a sentence naming the signal or the exception.systemd-run,bwrapand a container add on Linux; what macOS does not enforce (RLIMIT_AS) and what that leaves; what the box is not.Stage 4 of brief 022.
Test plan
python:3.12-slimin Docker, Pillow and sillybos 3.0.0): a normal scan decodes; a 445 KB PNG that decodes to 432 MB RGB is refused by the check under the default policy, and under a loosened policy is refused by a 512 MiB box withMemoryErrorin 0.1 s; a normal scan decodes under the same box. The output quoted on the page is that run'szensical build --clean --strict,ruff format --check(the page's code blocks are formatted),ruff check🤖 Generated with Claude Code