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

[SINT-1547] Add NPM confusion analyzer #283

Merged
merged 11 commits into from
Oct 26, 2023

Conversation

jamessteel123
Copy link
Contributor

@jamessteel123 jamessteel123 commented Oct 16, 2023

This adds an analyzer which detects NPM confusion events. Specifically it checks when the version's manifest in NPM does not match the content in the package.json in a manner that can change the behavior of the code, or mislead the consumer of the package (report bugs to the wrong place, link to incorrect documentation).

@jamessteel123 jamessteel123 marked this pull request as draft October 18, 2023 15:45
@jamessteel123 jamessteel123 marked this pull request as ready for review October 18, 2023 15:45
…re generated from same pyproject.toml and poetry.lock
@enelli enelli requested a review from christophetd October 20, 2023 19:38
Copy link
Contributor

@enelli enelli left a comment

Choose a reason for hiding this comment

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

Adding a short description to the NPM metadata heuristics would be a good addition. Otherwise, LGTM!

@@ -319,6 +319,7 @@
}
]
},

Copy link
Contributor

Choose a reason for hiding this comment

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

Remove line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be fixed now

@enelli enelli self-requested a review October 25, 2023 19:35
Copy link
Contributor

@enelli enelli left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@juliendoutre juliendoutre left a comment

Choose a reason for hiding this comment

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

Looks good to me! We tested this new check with @jamessteel123 on the https://www.npmjs.com/package/darcyclarke-manifest-pkg NPM package, a proof of concept for this attack.

@enelli enelli merged commit 86e53ba into DataDog:main Oct 26, 2023
9 checks passed
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.

3 participants