Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Read build matrix JSON explicitly #1461

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

joeyparrish
Copy link
Member

Because we used require() to read build-matrix.json, the file could be replaced with build-matrix.json.js, allowing code injection into our CI pipelines. This fixes this vulnerability by reading the JSON text with the fs module, then explicitly parsing it, rather than relying on require().

This also changes the location of the file, to match its location in other projects.

Note that this workflow is not currently giving any elevated permissions to users, so it is not currently possible to damage the repo through a PR. But this might have been possible in the past, due to organization-wide defaults for token permissions (recently fixed). No evidence has been found of past exploit.

See also shaka-project/shaka-streamer#216 and shaka-project/static-ffmpeg-binaries#57

Because we used require() to read build-matrix.json, the file could be replaced with build-matrix.json.js, allowing code injection into our CI pipelines.  This fixes this vulnerability by reading the JSON text with the fs module, then explicitly parsing it, rather than relying on require().

This also changes the location of the file, to match its location in other projects.
@joeyparrish joeyparrish merged commit 774cd3f into shaka-project:main Dec 16, 2024
38 checks passed
@joeyparrish joeyparrish deleted the build-matrix branch December 16, 2024 23:02
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Feb 14, 2025
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants