Skip to content

feat(sec): ignore install scripts in dev deps for better security posture - #45155

Open
hainenber wants to merge 3 commits into
masterfrom
sec/ignore-install-script-for-npm-dep-installation
Open

hainenber wants to merge 3 commits into
masterfrom
sec/ignore-install-script-for-npm-dep-installation

Conversation

@hainenber

Copy link
Copy Markdown
Contributor

sec(build): ignore install scripts in dev deps for better security posture

SUMMARY

Most of listed packages having install scripts are devDeps in nature, except for core-js-* which is still runnable if install script is not allowed as it's wrapped in try-catch.

To bettering the project's supply chain security, it's better to just ignore install scripts coming from all deps.

image

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TESTING INSTRUCTIONS

Green CI

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

…sture

Signed-off-by: hainenber <dotronghai96@gmail.com>
@hainenber hainenber changed the title sec(build): ignore install scripts in dev deps for better security posture feat(sec): ignore install scripts in dev deps for better security posture Oct 10, 2026
@codeant-ai-for-open-source

codeant-ai-for-open-source Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

CodeAnt  CodeAnt PR Risk

🟢  Low Risk

  • The PR appears safe to merge; no actionable issues were identified in the review.

Assessed commit: 0b1c421de70d

@codecov

codecov Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.72%. Comparing base (5ef84de) to head (0b1c421).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #45155      +/-   ##
==========================================
- Coverage   85.92%   84.72%   -1.21%     
==========================================
  Files        3122     3077      -45     
  Lines      216903   199596   -17307     
  Branches    51423    48060    -3363     
==========================================
- Hits       186380   169113   -17267     
- Misses      27106    27444     +338     
+ Partials     3417     3039     -378     
Flag Coverage Δ
javascript 82.75% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@EnxDev EnxDev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

CI is green with it, and none of the root or workspace package.json files define a pre or post script that would stop running, so the build itself looks unaffected.

One thing inline that I think needs a conscious decision before this merges.

Comment thread superset-frontend/.npmrc
@@ -1 +1,2 @@
min-release-age=3
ignore-scripts=true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This also turns off the @scarf/scarf postinstall, which is how the npm-install telemetry described in the FAQ (the Scarf section of docs/docs/faq.mdx) gets collected. It's a direct dependency with scarfSettings in package.json, so that looks deliberate.

Fine if the project is happy to lose that signal, but it should be a decision and not a side effect. If it goes, the FAQ wants updating in the same PR.

@hainenber hainenber Oct 13, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's actually a good point there, thanks @EnxDev!

npm 12 will disable install scripts by default) so I guess I'm doing a bit of premature future-proofing here.

I've created scarf-sh/scarf-js#84 so that maybe in the future, they'll find a way to migrate off postinstall script

Wdyt @rusackas? I'm happy with closing this PR since having telemetry collected is still crucial, I understand that.

@hainenber

Copy link
Copy Markdown
Contributor Author

Closing for now to avoid noises

@hainenber hainenber closed this Oct 14, 2026
@hainenber

Copy link
Copy Markdown
Contributor Author

Reopen again as we need to harden up the project.

@hainenber hainenber reopened this Nov 22, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants