Skip to content

[APS-19381] fix: harden .npmrc with supply-chain security directives#35

Closed
Rohannagariya1 wants to merge 2 commits into
browserstack:mainfrom
Rohannagariya1:fix/APS-19381-npmrc-hardening
Closed

[APS-19381] fix: harden .npmrc with supply-chain security directives#35
Rohannagariya1 wants to merge 2 commits into
browserstack:mainfrom
Rohannagariya1:fix/APS-19381-npmrc-hardening

Conversation

@Rohannagariya1

Copy link
Copy Markdown

Security Fix: APS-19381

Issue

The repo's .npmrc failed the weekly supply-chain .npmrc audit (SC-12282) — it only contained package-lock=true and was missing the required hardening directives.

Root Cause

Missing npm hardening directives that protect against malicious lifecycle scripts, TLS downgrade, version drift, and incompatible engines.

Fix Applied

Added the 6 required directives while preserving the existing package-lock=true line:

ignore-scripts=true
strict-ssl=true
save-exact=true
engine-strict=true
legacy-peer-deps=false
audit-level=high

This is a public repo, so access=restricted is intentionally omitted.

Testing

  • npm install succeeds (exit 0): added 969 packages, audited 970.
  • ignore-scripts=true correctly skips the postinstall (npm update browserstack-node-sdk) — no native deps in this repo, so this is acceptable and the install completes cleanly.
  • No engines field in package.json, so engine-strict=true has no adverse effect.

Jira Ticket

https://browserstack.atlassian.net/browse/APS-19381

Checklist

  • Security issue addressed
  • npm install validated with directives
  • BrowserStack session run (N/A — config-only .npmrc change, no dependency/SDK changes)

- Add ignore-scripts, strict-ssl, save-exact, engine-strict,
  legacy-peer-deps=false, audit-level=high
- Preserve existing package-lock=true
- Public repo: access=restricted intentionally omitted

Resolves: APS-19381

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Rohannagariya1 Rohannagariya1 requested a review from a team as a code owner June 11, 2026 19:51
@karanshah-browserstack

Copy link
Copy Markdown
Collaborator

Not needed on sample repo

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