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

NPM: not detecting postinstall scripts #175

Closed
emilva opened this issue Feb 21, 2023 · 6 comments
Closed

NPM: not detecting postinstall scripts #175

emilva opened this issue Feb 21, 2023 · 6 comments
Assignees
Labels
bug Something isn't working ecosystem/npm

Comments

@emilva
Copy link

emilva commented Feb 21, 2023

Hello team! Very cool tool you have created, and I am glad for the NPM support!

When testing this tool against different malicious packages I get no results, I took som examples from https://github.com/spaceraccoon/npm-zoo

For example:
https://github.com/spaceraccoon/npm-zoo/tree/master/packages/pizza-pasta/pizza-pasta-1.0.3

guarddog npm scan package.json
Found 0 potentially malicious indicators scanning package.json
guarddog npm verify package.json
Scanning using at most 16 parallel worker threads

Should this one be detected, or am not running the correct commands?

Cheers,

emil

@christophetd
Copy link
Contributor

Thanks for the report! We'll look into it shortly and get back to you

@christophetd
Copy link
Contributor

You should be running guarddog npm scan ./pizza-pasta-1.0.3:

image

Note that the ./ allows guarddog to understand that you're asking it to scan a local folder.

  • guarddog verify ./pizza-pasta-1.0.3/package.json will scan the dependencies described in this package.json file (which isn't what you want)
  • guarddog scan package.json will scan a remote npm package called "package.json"

Hope that clears things up!

@emilva
Copy link
Author

emilva commented Feb 21, 2023

Thanks @christophetd that clear things up!

I did try with guarddog npm scan . to scan the local directory, but then it also tried to check against the registry.

Cheers,

emil

@emilva emilva closed this as completed Feb 21, 2023
@christophetd
Copy link
Contributor

that's a good point, it should consider it a local path

@christophetd
Copy link
Contributor

Should be addressed by #176. Thanks for the report!

@emilva
Copy link
Author

emilva commented Feb 21, 2023

Nice, you are too fast! Thanks!

@emilva emilva closed this as completed Feb 21, 2023
christophetd added a commit that referenced this issue Feb 21, 2023
Consider 'guarddog xxx scan .' a local target (fixes #175)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ecosystem/npm
Projects
None yet
Development

No branches or pull requests

2 participants