Skip to content

fix(baseline): cap JSON baseline files before parsing - #35

Draft
harshitethic wants to merge 2 commits into
mainfrom
fix/bound-baseline-file-read-20261025
Draft

harshitethic wants to merge 2 commits into
mainfrom
fix/bound-baseline-file-read-20261025

Conversation

@harshitethic

Copy link
Copy Markdown
Owner

Problem

--baseline read the entire supplied file into memory without any bound, unlike scanner configuration reads. Accidentally passing an enormous file could consume excessive memory before reporting an error.

Fix

Limit baseline input to 16 MiB at the binary-read boundary before UTF-8 decoding and JSON parsing. Ordinary baseline files remain compatible.

Tests

A normal JSON baseline is accepted and a sparse oversized file is rejected without parsing. CI pending.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant