Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

docs: add FAQ explainer for dependency security vulnerability reports (#5691)

Copilot2517693683fd
diff --git a/docs-next/astro.config.ts b/docs-next/astro.config.ts
index 75b2c9c8..e9c23420 100644
--- a/docs-next/astro.config.ts
+++ b/docs-next/astro.config.ts
@@ -129,6 +129,10 @@ export default defineConfig({
label: "Run cycle overview",
slug: "explainers/run-cycle-overview",
},
+ {
+ label: "Security vulnerability reports",
+ slug: "explainers/security-vulnerability-reports",
+ },
{
label: "Shared behaviours",
slug: "explainers/shared-behaviours",
diff --git a/docs-next/src/content/docs/explainers/security-vulnerability-reports.mdx b/docs-next/src/content/docs/explainers/security-vulnerability-reports.mdx
new file mode 100644
index 00000000..a3e6a632
--- /dev/null
+++ b/docs-next/src/content/docs/explainers/security-vulnerability-reports.mdx
@@ -0,0 +1,33 @@
+---
+description: Information about security vulnerability reports in Mocha's dependencies
+title: Security Vulnerability Reports
+---
+
+{/* Use `ldquo` (left double quote) HTML because Astro wrongly makes it right quote otherwise */}
+
+## “`npm audit` or GitHub Advisories reported a vulnerability in a package Mocha depends on!"
+
+We probably know already 🙂
+
+First and foremost, please check [Mocha issue 5070](https://github.com/mochajs/mocha/issues/5070), which tracks all reported potential security issues.
+
+Second, please read the vulnerability to see if it actually applies to Mocha in your configuration (or any reasonable configuration you can imagine/test). As a test framework, Mocha is very unlikely to be affected by security vulnerabilities, as it only runs code that you as a developer provide to it.
+
+Finally, consider reading [Josh Goldberg's March 2025 blog on npm security reports](https://www.joshuakgoldberg.com/blog/please-stop-sending-me-nested-dependency-security-reports/). He's a Mocha maintainer and the core of the post remains true today.
+
+We appreciate your concern, but we don't want to overreact or stress ourselves out unless there is a real reason to believe Mocha itself is actually affected.
+
+## Why is Mocha less likely to be affected?
+
+As a test framework, Mocha:
+
+- Runs in a development environment, not production
+- Only executes code that you, as a developer, write and provide
+- Doesn't process untrusted user input in typical usage
+- Is not exposed to external networks in normal test scenarios
+
+Most security vulnerabilities in dependencies are relevant for production applications that handle user input, make network requests, or process untrusted data. These scenarios rarely apply to Mocha's use case as a testing tool.
+
+## What if there's a real security issue?
+
+If you believe you've found a genuine security vulnerability that affects Mocha itself (not just a transitive dependency), please report it responsibly through our [security policy](https://github.com/mochajs/mocha/blob/main/SECURITY.md).