facebook / facebook/docusaurus
Replace unmaintained dependency image-size with active CVEs (CVSS 7.5)
- Dominant language
- TypeScript
- Stars
- 66.2k
- Forks
- 10k
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 52
Description
### Have you read the Contributing Guidelines on issues?
- [x] I have read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#issues).
### Prerequisites
- [x] I'm using the latest version of Docusaurus.
- [x] I have tried the `npm run clear` or `yarn clear` command.
- [x] I have tried `rm -rf node_modules yarn.lock package-lock.json` and re-installing packages.
- [x] I have tried creating a repro with https://new.docusaurus.io.
- [x] I have read the console error message carefully (if applicable).
### Description
MDX Loader pulls in `image-size`. This dependency is now archived, see https://github.com/image-size/image-size#tired-maintainer-doesnt-want-your-slop
Two active CVES: CVE-2025-71329, CVE-2025-71330
CVE CWE: [835](https://cwe.mitre.org/data/definitions/835.html)
See https://joshua.hu/image-size-infinite-loop-dos-vulnerabilities for practical info.
I image there will be an alternative fork out there somewhere, or another util that could be used.
### Reproducible demo
_No response_
### Steps to reproduce
```
$ yarn why image-size
yarn why v1.22.22
[1/4] 🤔 Why do we have the module "image-size"...?
[2/4] 🚚 Initialising dependency graph...
[3/4] 🔍 Finding dependency...
[4/4] 🚡 Calculating file sizes...
=> Found "image-size@2.0.2"
info Reasons this module exists
- "@docusaurus#core#@docusaurus#mdx-loader" depends on it
- Hoisted from "@docusaurus#core#@docusaurus#mdx-loader#image-size"
info Disk size without dependencies: "748KB"
info Disk size with unique dependencies: "748KB"
info Disk size with transitive dependencies: "748KB"
info Number of shared dependencies: 0
```
### Expected behavior
Less CVEs in my pipelines ;(
### Actual behavior
2 CVEs in my pipeline :(
### Your environment
### Self-service
- [ ] I'd be willing to fix this bug myself.
Contributor guide
Research direction
Start with the @docusaurus/mdx-loader dependency path identified by `yarn why image-size`, then inspect how that package is declared and used. Compare a maintained replacement or fork that preserves the loader’s image-dimension behavior, and verify completion with `yarn why image-size` plus the project’s dependency or security checks showing the vulnerable package is gone.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- build-system, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100