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 #59

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 exploit was discovered by a researcher, and the researcher's activity was spotted within hours. Workflows were immediately suspended. No evidence has been found of any tampering in this repository or its releases.

Issue #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 exploit was discovered by a researcher, and the researcher's activity was spotted within hours.  Workflows were immediately suspended.  No evidence has been found of any tampering in this repository or its releases.

Issue shaka-project#57
@joeyparrish
Copy link
Member Author

Workflows are still suspended, but functionality has been verified on my fork.

Copy link
Member

@mariocynicys mariocynicys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Q: is this vulnerability documented/published anywhere? I see the faulty PRs have been removed, and I wanted to see an example on action :)

@joeyparrish
Copy link
Member Author

There were two parts, which I will document more fully on the issues in these two repos as soon as I'm done with this audit and have re-enabled workflows.

@joeyparrish joeyparrish merged commit 7f593bd into shaka-project:main Dec 16, 2024
1 check passed
@joeyparrish joeyparrish deleted the build-matrix branch December 16, 2024 22:35
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.

2 participants