Safeguard
Security Guides•

How do you tell whether a malicious package actually ran?

Check install logs, process and network records, file changes and credential use. A log source table and a short hunt routine for a suspect package.

Safeguard Security Team
3 min read

To tell whether a malicious package ran, look for four kinds of evidence: install or build logs showing it was fetched, process records showing scripts executed, network records showing outbound connections, and credential logs showing unusual use afterwards. Absence of evidence is only meaningful if those logs exist for the window.

Start with the window

Get the publish and removal times of the bad version. Only installs and builds inside that window could have fetched it, unless a cache or mirror kept serving it. Narrow every search to that window plus a margin for caches.

Log sources

SourceWhat to look forTypical gap
CI job logsInstall step fetching the version, unexpected commandsLogs expire
Package proxy or mirror logsWho downloaded the version, and whenNot every team has a proxy
Endpoint process logsChild processes of the package managerOften not collected on laptops
DNS and network egressLookups to hosts you do not knowShort retention
Cloud and source audit logsCredential use from new placesGitHub keeps 180 days in its organization audit log
Git historyNew workflow files, new deploy keys, changed hooksForce pushes hide changes

Hunt routine

  1. List every environment that installed the package in the window, using lockfiles, SBOMs and proxy logs.
  2. For each, read the install log. npm runs install scripts of dependencies by default, so a script that did something odd would run at this point.
  3. Check egress for the same period. A build runner talking to a host outside your usual registries and source hosts is a lead.
  4. Check the credential audit logs for each secret that environment could read. Look for use from unfamiliar addresses.
  5. Look for persistence: new or changed workflow files, git hooks, shell profile entries, scheduled jobs.
  6. Write down what you checked and what logs were missing.

Reading the result

Found evidence of execution means move to the executed level and rotate. No evidence with complete logs is a reasonable not found. No evidence with missing logs means unknown, so rebuild clean and rotate anyway if the environment held powerful secrets.

For a broader walkthrough, see investigating a CI/CD compromise.

Keep a hunt log

Write each query you ran, the system it ran against, the time range and the result, including empty results. A hunt log turns a vague we looked into a statement someone can check later. It also stops two people repeating the same search while a gap goes unexamined. When you finish, list the logs you wished you had, such as egress records for build runners, and add them to the hardening backlog.

Quick check

What if we do not keep egress logs?

Treat the result as unknown and act on the safer assumption, then start keeping egress logs for build systems.

Is a quiet log proof of a clean run?

Only if the log covers the right systems and time. Say what was and was not covered.

Safeguard's SBOM and dependency scanning can show which projects carried the package, which narrows the hunt. A free scan is at gold.safeguard.sh/scan.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.