返回提示词目录第 1348 页

恶意依赖包暴露排查与响应规划

依据安全通告排查恶意依赖的安装与执行范围,整理受影响清单、凭据轮换及清理方案。

完整提示词

<context>
A hijacked package release is different from a vulnerable one: the code is hostile on purpose, and in ecosystems with install hooks (npm `preinstall` and `postinstall`, Python source distributions running `setup.py`, and similar) it runs the moment someone installs it, before any of your code imports it. That means the exposed places are not only production but every developer laptop and CI job that installed the version during the window, and the targets are usually the secrets present there: environment variables, cloud credential files, `.npmrc` and `.pypirc` tokens, SSH keys, browser data. Recent campaigns also used stolen publish tokens to republish the victims' own packages, so a team that maintains packages must check its own releases. Lockfiles are the fastest map of exposure, but ranges in manifests, cached layers in container images and lockfile-less installs (global tools, Dockerfiles running `npm install` or `pip install` without pins) also count. The response is decided by facts in the advisory, which must be quoted, not remembered.
</context>

<task>
Respond to this advisory:

<advisory>
{{advisory}}
</advisory>

<environment>
{{environment}}
</environment>
{{#findings}}

<findings>
{{findings}}
</findings>
{{/findings}}

1. Advisory facts: extract package, ecosystem, malicious versions, window, behaviour and indicators exactly as stated. List what is missing and stop to ask if the malicious versions are unknown.
2. Exposure search: if you have repository access, search the lockfiles and manifests yourself (`package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, `poetry.lock`, `Pipfile.lock`, `requirements*.txt`, `go.sum`, `Gemfile.lock`, `Cargo.lock` and others for the ecosystem), including transitive entries, and report each hit with file and line. Give equivalent commands for other repositories, CI logs, container images or SBOMs, and developer machines.
3. Affected list: table of every place the malicious version is or was present, with whether it was installed during the window.
4. Where it ran: for each affected place, decide whether the malicious code executed (install hooks, import at runtime) and what it could reach. Look for the advisory's indicators in network and EDR logs.
5. Rotate: secrets on every machine and CI job where it ran, highest blast radius first, and a check of audit logs for their use. If you publish packages, check your own registry releases in the window for unexpected versions.
6. Clean and pin: move to the advisory's safe version, update lockfiles, clear package manager caches and rebuild container images from clean layers; for developer machines where it ran, decide between targeted cleanup per the advisory and reimaging.
7. Prevent a repeat: lockfiles enforced in CI (`npm ci` or equivalent), a minimum release age or cooldown for new versions, install scripts disabled by default where the ecosystem allows, scoped and short-lived publish tokens, and point to dependency vetting.
</task>

<constraints>
- Quote the advisory for versions and behaviour. Never guess malicious versions, indicators or safe versions.
- Read files and run searches only; editing lockfiles, clearing caches or rebuilding images are changes to confirm with the user first.
- Do not print secret values found during the search.
- Separate what you verified in the repository from what the user must check elsewhere.
{{> output/uncertainty}}
</constraints>

<output_format>
## Advisory facts
Bullets quoting the advisory, plus missing facts.

## Exposure search
What was searched, commands for the rest, results.

## Affected list
Table: Location | Version | Installed in window? | Ran? | Evidence.

## Where it ran
Bullets per location with reachable secrets.

## Rotate
Ordered list with audit-log checks.

## Clean and pin
Ordered list, changes marked "(confirm first)".

## Prevent a repeat
Short list.
</output_format>

可替换内容

  • {{advisory}}
  • {{environment}}
  • {{#findings}}
  • {{findings}}
  • {{/findings}}
  • {{> output/uncertainty}}

分类与标签

编程开发、软件供应链安全、恶意依赖排查、凭据轮换、事件响应

前往 AI 图片创作