mirror of
https://github.com/pnpm/pnpm.git
synced 2026-07-26 07:27:20 -04:00
fix: audit fix should not add an override for a vulnerability that has no fix
This commit is contained in:
6
.changeset/healthy-masks-rescue.md
Normal file
6
.changeset/healthy-masks-rescue.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/plugin-commands-audit": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
`pnpm audit --fix` should not add an override for a vulnerable package that has no fixes released.
|
||||
@@ -22,7 +22,7 @@ export default async function fix (dir: string, auditReport: AuditReport) {
|
||||
function createOverrides (advisories: AuditAdvisory[]) {
|
||||
return fromPairs(
|
||||
advisories
|
||||
.filter(({ vulnerable_versions }) => vulnerable_versions !== '>=0.0.0') // eslint-disable-line
|
||||
.filter(({ vulnerable_versions, patched_versions }) => vulnerable_versions !== '>=0.0.0' && patched_versions !== '<0.0.0') // eslint-disable-line
|
||||
.map((advisory) => [
|
||||
`${advisory.module_name}@${advisory.vulnerable_versions}`,
|
||||
advisory.patched_versions,
|
||||
|
||||
Reference in New Issue
Block a user