Hoc npm vulnerability

From openreachtech/hora-skills-ort-core · View interactive version

Hoc npm vulnerability is an AI agent skill from the GitHub repository openreachtech/hora-skills-ort-core. How to settle what `npm audit` reports, and how the audit and the release-age quarantine together keep a vulnerable version out of a project. Use when an audit reports an advisory, when a fix is younger than the quarantine, or when no release fixes it. Raising declared versions belongs to the depend

How to use this skill

Skill file

npm Vulnerability

Two mechanisms keep a vulnerable version out, answering two different questions. **The audit

answers what is known to be bad. The quarantine answers what nobody has looked at yet.**

Neither covers the other's ground.

The order of work when `npm audit` reports

Take the steps in this order. A later step is reached only for what the earlier ones left.

1. Raise the declared dependencies within their minor range

Raise each declared entry to the newest minor or patch release its own range permits, as the

dependency-raising convention does, and never across a major. Read the audit after its

single install, never before. Part of what the audit reported may already be fixed by a newer

release.

vulnerable copies to two, with nothing else changed.

2. Raise the transitive dependency with `overrides`

An advisory usually names a package the project never asked for. Where the vulnerable

package is a dependency of a dependency, raise it through overrides in package.json.

  "overrides": {
    "alpha-package": "^3.4.4",
    "beta-package@2": "^2.3.2"
  }

version in package-lock.json alone, and the record of why disappears with it. A fact held

only in a generated file cannot be read by anyone. overrides states it in the manifest.

later on its own merits.

moves every copy, at every depth, whatever each dependant declared.

asked for; only the call says whether the version delivered answers. Where the call site

survives, leave the key unscoped; where it does not, scope the key to the major line the

advisory names. Neither the package's reputation nor the size of the jump settles it.

declared range excludes, take it: raise the declared range for a direct dependency, or write

the override for one reached through another package. Whether a major was crossed does not

decide this; whether the raise makes the project safe does. This is the exception to the

dependency-raising convention's rule that a major is a decision of its own, and it holds for

the fix of an advisory only.

fails, the fix cannot be taken as it stands, and the report goes to step 4.

3. A fix exists but is younger than the quarantine

An override names a version, and that version is subject to the quarantine like any other.

Read when the fix was published from the registry before writing the override, not after an

install fails.

failing until the fix is taken, and a pull request cannot merge while it fails. Severity

does not decide this; whether the pull request can merge does.

--min-release-age-exclude route /hoc-npm-install defines.** The quarantine stays on

every other package.

4. No release fixes the advisory

An override needs a version to raise to. **Where the advisory names no patched release, or

the fix cannot be taken — not even through the exception of step 3, or because the tests or

the lint fail after the raise — the report is not resolved. It is decided, and the user

decides it.** Report the advisory and the manifest field its package is reached through, and

present the two ways: listing it, or reworking the code.

route by which the package is in the tree, and one route through dependencies or

peerDependencies is enough for the package to count as shipped.

| The vulnerable package is reached through | Way forward |

| :-- | :-- |

| devDependencies only | List it |

| dependencies or peerDependencies, directly or through another package | The user chooses between listing it and reworking the code |

merge while the audit fails.

resolution. In a shipped dependency it leaves the vulnerable code in what is deployed, so the

report to the user says that in plain words.

never starts it on its own. Where the package is reached only through another package, the

application code cannot be reworked to avoid it, and listing is the way left.

what fails the audit, for the time being. Each entry carries its reason and the condition

for removing it.

decided alone.

issue that names the advisory, the package, why it was listed and the condition for

removing it, and file it once the user has approved the text. A listing without such an

issue is forgotten.

the audit. A patched release ends the entry: from then on the report is an ordinary one,

resolved by step 2. The entry is removed rather than renewed, and the issue is closed.

Why the audit alone is not enough

npm audit reports registered advisories, and nothing else. An advisory exists after

somebody notices, files it, and it is accepted, so every compromised package has an interval

in which the audit called it clean. "No vulnerabilities" means "no advisory today", one

check that passed and not a conclusion.

What the audit misses by construction — a version too new for anyone to have looked at — is

what the quarantine covers: a release-age setting refuses any package published more

recently than a given number of days, so that somebody else meets a bad publish first. The

setting is a line of .npmrc, written as /hoc-npm-npmrc says.

The quarantine applies to a resolving install and not to a lockfile install.

| Command | Subject to the quarantine |

| :-- | :-- |

| A resolving install | Yes — every candidate's age is checked |

| A lockfile install (npm ci) | No — the versions are already pinned |

quarantine is enforced at the moment of resolution, by whoever runs it. Review the

resolution, not the installs after.

Measure an audit by installing, never from the lockfile alone

An audit run against the committed lockfile reuses the pins that lockfile holds, so it

reports the vulnerabilities of the old resolution, and can report clean where a fresh

resolution would not. A real install re-resolves and can give a different answer entirely.

A measurement of an audit that did not install is not a measurement. Install, then read

the report.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.