Skip to content

bounds-check source file index in source map vlq parser#499

Open
sahvx655-wq wants to merge 1 commit into
google:mainfrom
sahvx655-wq:sourcemap-source-index-bounds
Open

bounds-check source file index in source map vlq parser#499
sahvx655-wq wants to merge 1 commit into
google:mainfrom
sahvx655-wq:sourcemap-source-index-bounds

Conversation

@sahvx655-wq

Copy link
Copy Markdown

Spotted this reading the source map parser. The sources array is bounds-checked nowhere before ForEachVLQSegment indexes it with sources[source_file], but source_file comes straight out of the mappings VLQ stream and is a signed int32 that can be negative or past the end of sources. A crafted .map walks off the vector. Reject the out-of-range index before the lookup, the same way the surrounding parser already throws on malformed input.

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