Skip to content

[Snyk] Security upgrade dompurify from 3.3.3 to 3.4.0#6048

Open
maidul98 wants to merge 1 commit intomainfrom
snyk-fix-d7cf75bb3d8cda270e4562f2ab99d2b6
Open

[Snyk] Security upgrade dompurify from 3.3.3 to 3.4.0#6048
maidul98 wants to merge 1 commit intomainfrom
snyk-fix-d7cf75bb3d8cda270e4562f2ab99d2b6

Conversation

@maidul98
Copy link
Copy Markdown
Collaborator

snyk-top-banner

Snyk has created this PR to fix 1 vulnerabilities in the npm dependencies of this project.

Snyk changed the following file(s):

  • frontend/package.json
  • frontend/package-lock.json

Vulnerabilities that will be fixed with an upgrade:

Issue
medium severity Operator Precedence Logic Error
SNYK-JS-DOMPURIFY-16078387

Important

  • Check the changes in this PR to ensure they won't cause issues with your project.
  • Max score is 1000. Note that the real score may have changed since the PR was raised.
  • This PR was automatically created by Snyk using the credentials of a real user.

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.

For more information:
🧐 View latest project report
📜 Customise PR templates
🛠 Adjust project settings
📚 Read about Snyk's upgrade logic


Learn how to fix vulnerabilities with free interactive lessons:

🦉 Learn about vulnerability in an interactive lesson of Snyk Learn.

@maidul98
Copy link
Copy Markdown
Collaborator Author

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Comment thread frontend/package.json
@@ -92,7 +92,7 @@
"cva": "npm:class-variance-authority@^0.7.1",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 This PR bumps dompurify to 3.4.0 (published 2026-04-14), but the repo's frontend/.npmrc enforces min-release-age=7, meaning the package won't satisfy the constraint until 2026-04-21. Any developer who deletes package-lock.json and runs npm install between now and April 21 will get a resolution failure. Consider delaying merge until April 21 or pinning an older version that already satisfies the 7-day window.

Extended reasoning...

What the bug is and how it manifests

The repository explicitly enforces a supply-chain security policy via frontend/.npmrc: min-release-age=7. This setting, documented in root CLAUDE.md ("Both backend/ and frontend/ enforce a minimum release age of 7 days for npm packages... This means npm install will only resolve package versions published at least 7 days ago"), prevents npm from resolving packages published less than 7 days ago during dependency resolution.

dompurify 3.4.0 was published on 2026-04-14T07:51:39Z. This PR was opened 2026-04-16 — exactly 2 days later. The 7-day minimum-age window does not expire until 2026-04-21.

The specific code path that triggers it

Snyk runs in its own environment (likely without the local .npmrc policy), so it successfully resolves and pins dompurify 3.4.0 in package-lock.json. In the repo, any developer who regenerates the lockfile (deletes package-lock.json and runs npm install) before April 21 will trigger npm's dependency resolution phase, during which npm will see dompurify@^3.4.0 in package.json, attempt to resolve it, and the min-release-age=7 check will block 3.4.0 as it's only 2 days old.

Why existing code doesn't prevent it

The .npmrc policy is intentionally designed to protect against supply-chain attacks on newly published packages. However, Snyk's automated PR generation bypasses this check because Snyk runs in a sandboxed environment without the project's local .npmrc. The policy is enforced locally and in CI only when npm install (with resolution) is invoked — not when npm ci is used (which reads the lockfile directly, bypassing resolution entirely).

What the impact would be

The refutation correctly notes that npm install with an existing, compatible lockfile does not re-resolve dependencies, so ordinary developer npm install runs are unaffected. Similarly, npm ci (used in CI/CD pipelines) is unaffected. The failure scenario is narrowed to: a developer deletes package-lock.json (e.g., to resolve a merge conflict, add a new dependency from scratch, or troubleshoot) and runs npm install before April 21. During that ~5-day window, the install would fail with an error citing the min-release-age constraint. This is a real — if limited — developer friction point that directly contradicts the project's documented security policy.

How to fix it

The simplest fix is to delay merging this PR until 2026-04-21, when dompurify 3.4.0 will satisfy the 7-day constraint. Alternatively, if the security vulnerability is urgent enough to merge immediately, team members should be warned not to regenerate the lockfile until April 21.

Step-by-step proof

  1. Confirm: frontend/.npmrc contains min-release-age=7
  2. Confirm: dompurify 3.4.0 published 2026-04-14 (npm registry: "time": {"3.4.0": "2026-04-14T07:51:39.768Z"})
  3. PR opened: 2026-04-16. Age of 3.4.0 at PR creation = 2 days < 7 days required
  4. Developer action: rm frontend/package-lock.json && npm install (in frontend/)
  5. npm resolves dompurify@^3.4.0 → finds 3.4.0 as latest matching version
  6. npm checks min-release-age=7 → 3.4.0 is 2 days old → resolution blocked
  7. Result: npm ERR! No matching version found for dompurify@^3.4.0 (or equivalent min-release-age error)
  8. After 2026-04-21: same steps succeed normally — the issue is self-resolving

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