
A maintainer reports that a package version contained malicious code. Your repository uses that package, and someone has already opened an upgrade pull request. Before closing the issue, establish which builds consumed the affected version, where those builds went and what the package could execute along the way.
Start with the exact affected package
Save the maintainer’s or vendor’s advisory, including its update time. Record the ecosystem, package name, affected versions, publication window, known file hashes and execution conditions. Check whether the incident involves a direct dependency, a nested dependency, a build plugin or a development tool. Assign an owner to update that scope when the advisory changes.
Preserve the relevant build logs and package evidence before routine cleanup removes them. Use existing records and safe offline inspection first. Reinstalling a suspicious package to “see what happens” can create a new exposure.
CISA’s September 2025 npm alert explicitly recommended checking lockfiles, nested dependencies and cached packages. Those are useful investigation locations; its incident-specific version cutoffs should not be reused for a different event. CISA npm supply-chain alert.
Trace the version that each build resolved
Inspect the lockfile at the commit used by each potentially affected build. Today’s corrected branch does not describe yesterday’s deployment. Follow the full dependency path and record the resolved version, package location and integrity information where available. Include release branches and separate workspaces.
npm documents its lockfile as a record of the generated dependency tree. Treat a match as evidence for that dependency resolution, then look for the install and build that used it. npm package-lock documentation.
| Evidence found | What you can conclude | What remains open |
|---|---|---|
| Affected version in historical lockfile | That revision resolves the package | Whether a relevant job installed it |
| Install record linked to a build | The job consumed that package | Which code ran and what it could access |
| Affected code in deployed artifact | The deployment contains that code | Whether the suspicious path executed |
| Correlated execution evidence | A specific behavior occurred | Its full scope, persistence and consequences |
For each row, attach a record identifier and timestamp. “Unknown” is a useful result when it names the missing evidence and the person responsible for finding it.
Follow the affected version through your delivery path.
Each step answers a different question. Preserve the links between records so a later conclusion can be checked.
Resolved version
Match the advisory to the lockfile used by a specific commit.
Install and build
Inspect job records, script policy and the process identity.
Deployed artifact
Connect the build’s digest to environments that received it.
Execution evidence
Check the relevant behavior, effects and remaining log gaps.
Installation scripts may execute before deployment. Runtime execution is a separate path that needs its own evidence.
Inspect installation and build execution
Separate installation hooks from code loaded by the application. In npm v11, lifecycle scripts can run during installation, subject to configuration. A development-only tool may therefore matter on a build worker even if it is absent from the final application. Record the actual package-manager version, command and script policy used by the job. npm lifecycle documentation.
The npm v11 documentation also explains that omitted dependencies may remain in a lockfile without being installed on disk. Its ignore-scripts setting suppresses package scripts, but an explicitly requested script can still run. Check the historical configuration and later build commands before concluding that a package never executed. npm installation configuration.
For an illustrative formatting-tool compromise, record whether the affected build job actually invoked that formatter, which identity ran it, and which secrets or files were accessible. That creates a focused investigation scope without claiming those resources were stolen.
Connect build outputs to actual deployments
Follow the build identifier to its artifact digest, then find the deployments that used that exact artifact. Check application containers, serverless bundles, background workers and browser assets where relevant. A package can be transformed or bundled, so a filename search alone may miss its code. Use available build manifests, source maps and an artifact-specific software bill of materials to help trace inclusion.
A verified attestation can link an artifact to its repository, commit and build workflow. GitHub’s documentation describes these provenance claims and stresses verification. That link helps identify the right build; it does not establish that its dependencies were harmless. GitHub artifact attestations.
Also record deployments that were replaced or rolled back during the affected period. A current clean image cannot answer what was served earlier.
Evaluate execution with the right evidence
Use the advisory’s execution conditions to guide review of process records, build output, application telemetry, outbound connections and relevant audit logs. Distinguish code present in an artifact from code loaded at startup or called by a user workflow. Missing logs leave uncertainty; they do not prove that nothing happened.
A CVE or advisory scan is one input. npm audit asks the registry for known vulnerabilities in the dependency set. A clean result does not prove that no malicious dependency was installed or executed, and some malicious-package reports may appear in advisory data. npm audit documentation.
Keep ordinary vulnerability prioritization separate from incident evidence. Our CVE prioritization guide explains the patching decision; this investigation establishes which environments encountered the reported compromise.
Recover, then verify the replacement release
When compromise is suspected or confirmed, involve the incident owner and contain affected environments according to the evidence and response plan. Preserve what responders need before rebuilding. CISA’s May 2026 supply-chain guidance recommends reviewing CI/CD logs, cloud audit trails and affected developer machines, and rotating or revoking accessible secrets when compromise is discovered. CISA response guidance.
Select a trusted replacement version, repair the dependency path and rebuild from a trusted environment. Verify the replacement artifact and its deployment. If credentials were exposed, coordinate their replacement with containment so newly issued credentials do not enter an affected environment. Our exposed API key guide covers that follow-up.
Close with an evidence summary: affected builds and environments, observed behavior, recovery actions and unresolved gaps. Assign each gap an owner instead of turning an incomplete investigation into an assurance statement.
Scope the application follow-up
Sectiv is a security software subscription configured for each business, with web, API and source review, AI validation, and expert configuration and support. Bring the advisory, dependency path and application workflows to discuss the assessment scope. Agree what the application review can verify and which incident-response or forensic work needs separate ownership.
Common questions
Does an affected package in a lockfile prove compromise?
It establishes a dependency-resolution match for that revision. You still need to connect it to an installation or build, determine what executed and investigate the relevant effects. Preserve the distinction in your report so responders can see where the evidence stops.
Can a development dependency affect production security?
Yes. A tool used during installation or a build can access resources available to that process or alter build output. Its absence from the deployed dependency list does not settle whether the build environment or resulting artifact was affected.
Is upgrading the dependency enough?
Upgrading addresses future use of the affected version. If malicious code already executed, investigate accessible credentials, modified files and other effects indicated by the advisory and evidence. Verify the replacement build and deployment, and retain any unresolved uncertainty in the incident record.
YOUR NEXT STEP
Understand which application paths need review.
Need an application review after a dependency alert? Bring the advisory and build context to discuss what Sectiv can assess.
Book a demo