Skip to content

Compromised AsyncAPI npm Packages Inside a CI Supply-Chain A... - #394

Open
carlospolop wants to merge 1 commit into
masterfrom
update_Compromised_AsyncAPI_npm_Packages_Inside_a_CI_Su_c6f9416240b64570
Open

carlospolop wants to merge 1 commit into
masterfrom
update_Compromised_AsyncAPI_npm_Packages_Inside_a_CI_Su_c6f9416240b64570

Conversation

@carlospolop

Copy link
Copy Markdown
Collaborator

🤖 Automated Content Update

This PR was automatically generated by the HackTricks News Bot based on a technical blog post.

📝 Source Information

  • Blog URL: https://securitylabs.datadoghq.com/articles/compromised-asyncapi-npm-packages
  • Blog Title: Compromised AsyncAPI npm Packages: Inside a CI Supply-Chain Attack
  • Suggested Section: Pentesting CI/CD > GitHub Security > Abusing GitHub Actions — add or expand a PwnRequest/pull_request_target page with delayed runner secret collection, actions/checkout post-job tampering, deleted-fork evidence recovery, and release-workflow/package-publishing abuse

🎯 Content Summary

Overview and impact

On July 14, 2026, a threat actor compromised the AsyncAPI release process and published credential-stealing code in four npm packages totaling more than three million weekly downloads. The attack chained a GitHub Actions PwnRequest weakness, execution of attacker-controlled JavaScript in a privileged CI context, theft of the asyncapi-bot GitHub token, malicious branch operations, and abuse of the legitimate npm release workflow.

...

🔧 Technical Details

Privileged CI execution through pull_request_target: A PwnRequest occurs when a GitHub Actions workflow uses pull_request_target and then executes, imports, or builds content controlled by an untrusted pull request. The workflow operates in the base repository's security context, so attacker-controlled files may gain access to privileged workflow tokens, repository state, actions, and secrets. Exploitation consists of modifying a path accepted by the workflow and embedding code that the preview, documentation, test, or build system evaluates. Avoid checking out or evaluating fork code in a privileged workflow; separate untrusted builds from any job that receives secrets or write-capable tokens.

Concealing malicious CI activity with pull-request spam: Attackers can surround an exploit PR with many harmless-looking requests to hide it from maintainers and complicate later reconstruction. Defenders should inspect missing...

🤖 Agent Actions

Plan:

  1. Map the CI/CD and GitHub Actions documentation and inspect at least five relevant pages.
  2. Compare existing coverage against the supplied research and verify primary GitHub documentation/source details where useful.
  3. Update the single best existing page, preserving its structure and reference numbering.
  4. Review the diff and run focused Markdown/link checks.
    I found an existing GitHub Actions page specifically covering npm supply-chain abuse, plus adjacent pages on deleted GitHub data, context injection, artifact/cache poisoning, and the section index. I’ll compare all of these before deciding whether the new CI persistence and forensic reconstruction material belongs in that existing page.
    The repository already documents the basic pull_request_target PwnRequest, deleted-fork object retention, and npm provenance’s trust limitation. The genuinely new material is the CI-aware timing chain: keeping an observer alive for later process environments, repatching a JavaScript action’s post hook, reconstructing erased workflow activity, and using a stolen bot identity to satisfy release predicates. I’m checking for any hidden duplication before editing one page only.
    Decision: update the existing abusing-github-actions/README.md. It is the canonical PwnRequest page and already links to specialized npm and deleted-data pages, so a new page would fragment the chain. I’ll add only the missing technical behavior and forensic workflow, while linking rather than re-explaining material already covered elsewhere.
    Implementation plan updated:
  • Add two focused subsections beneath pull_request_target: delayed same-job credential capture/action post-hook tampering, then API/transparency-log reconstruction and release pivoting.

  • Reuse existing references for PwnRequest, runner hardening, and provenance; append only the pinned actions/checkout manifest and the original Datadog research.

  • Keep all new material in this one file.
    The edit now covers the complete missing chain without duplicating the malware catalog or existing npm page. I’m validating reference anchors, internal links, citation numbering, Markdown whitespace, and the mdBook build.
    All focused validations pass. The full mdBook build cannot run because mdbook is not installed in this environment; I’ll perform one final diff/stat and forbidden-source check before finishing.
    Updated src/pentesting-ci-cd/github-security/abusing-github-actions/README.md with:

  • Delayed /proc/*/environ credential collection.

  • Detached CI observers.

  • actions/checkout post-job tampering.

  • Deleted fork/workflow evidence recovery using GitHub APIs.

  • Bot-token branch and release-workflow abuse.

  • Provenance and Rekor authorization limitations.

  • Technical detection and hardening guidance.

  • Numbered citations to the Datadog research and pinned checkout manifest.

Validation:

  • git diff --check passed.
  • Citation numbering and internal links verified.
  • No forbidden sources added.
  • mdbook build skipped because mdbook is not installed.

This PR was automatically created by the HackTricks Feed Bot. Please review the changes carefully before merging.

📚 Repository Maintenance

  • MD files processed: 804
  • MD files fixed: 7

All .md files have been checked for proper formatting (headers, includes, etc.).

@carlospolop

Copy link
Copy Markdown
Collaborator Author

🔗 Additional Context

Original Blog Post: https://securitylabs.datadoghq.com/articles/compromised-asyncapi-npm-packages

Content Categories: Based on the analysis, this content was categorized under "Pentesting CI/CD > GitHub Security > Abusing GitHub Actions — add or expand a PwnRequest/pull_request_target page with delayed runner secret collection, actions/checkout post-job tampering, deleted-fork evidence recovery, and release-workflow/package-publishing abuse".

Repository Maintenance:

  • MD Files Formatting: 804 files processed (7 files fixed)

Review Notes:

  • This content was automatically processed and may require human review for accuracy
  • Check that the placement within the repository structure is appropriate
  • Verify that all technical details are correct and up-to-date
  • All .md files have been checked for proper formatting (headers, includes, etc.)

Bot Version: HackTricks News Bot v1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant