Defang: an over-privileged dev GitHub App tagged a release and copied production

On Nov 12, 2026, an attacker acted as an internal Defang development GitHub App that held excess deployment-environment permissions and pushed a malicious commit and release tag. Because Defang’s production CI trusted release tags automatically, the attacker’s code ran with production credentials, copied the main database, and held live Stripe, encryption, and GitHub App keys for 11 days until a routine scan caught it on Nov 23.

How they got in

On Nov 12, 2026, an attacker acted as a separate GitHub App that Defang maintained for local development and testing. That dev App was installed on two internal Defang repositories and held far more permissions than it needed, including permission to change deployment environments. Defang has not determined how the attacker obtained the dev App’s credentials, so the initial key theft stays marked withheld. (Defang also noted applying a dependency security update on Nov 15, without confirming a link.)

Acting as that dev App, the attacker pushed a commit to one of the repositories and tagged it as a release. Defang’s production deployment environment automatically trusted release tags, so the attacker’s code ran inside CI with live build credentials: first against dev and staging at 06:05 UTC, and then with production credentials at 06:26 UTC.

Source controlDefang CI and prodStayed safeExposed keys and riskAttackerApp key source withheldMalicious release tagPushed by dev AppProduction CI runnerAuto-trusted release tagsMain database copyCopied 07:57–08:10 UTCPasswords and full cardsNever stored by DefangStolen service keysValid 11 days (to Nov 23)Customer OIDC riskdefang-cd-CIRole path1234
1Nov 12, 06:05 UTC

Acting as an internal dev/test GitHub App installed on two repositories with excess permissions, the attacker pushes a malicious commit and tags it as a release.

InferredWhere to stop it: lock tags with tag rulesets
  1. Nov 12, 06:05 UTC

    Acting as an internal dev/test GitHub App installed on two repositories with excess permissions, the attacker pushes a malicious commit and tags it as a release.

    AttackertoMalicious release tag
  2. Nov 12, 06:05–06:26 UTC

    Because Defang’s production environment trusted release tags automatically, attacker code copies dev/staging secrets at 06:05 UTC and production secrets at 06:26 UTC.

    Malicious release tagtoProduction CI runner
  3. Nov 12, 07:57–08:10 UTC

    The attacker copies the main database (all Portal users, Compose files, and Oct 12–Nov 19 deployment state with DB passwords) and holds live Stripe, GitHub App, and token encryption keys until Nov 23.

    Production CI runnertoMain database copyStolen service keys
  4. Nov 12–23, 2026

    Holding the Defang GitHub App key creates an indirect path into connected customer repos and workflows assuming admin cloud deploy roles like defang-cd-CIRole. A routine scan catches the compromise on Nov 23.

    Main database copyStolen service keystoCustomer OIDC risk

Figure 1. How the attack unfolded, and what stayed isolated. Select any step or box for details.

What they took

Armed with production credentials, the attacker copied Defang’s main database between 07:57 and 08:10 UTC on Nov 12. That dump exposed every Defang Portal user’s name, email address, GitHub or GitLab username and organization names, signup answers, connected cloud account IDs, Compose files, and (for users who deployed between Oct 12 and Nov 19) copies of deployment state that can contain database passwords or environment variables built from defang config values.

The stolen production credentials also included Defang’s Stripe API key (exposing billing contact details, card brand, last four digits, expiry, and invoices), the production Defang GitHub App key, and the encryption key protecting stored customer GitHub sign-in tokens. All of those keys stayed valid for 11 days until a routine security scan spotted suspicious repository activity on Nov 23. Because the production GitHub App key allowed pushing commits, editing workflows, and changing environment rules in connected customer repositories, anyone holding it could indirectly trigger a customer’s GitHub Actions workflow to assume the customer’s cloud deploy role (such as AWS defang-cd-CIRole, which often holds administrator access). Defang rotated all keys, suspended the dev App, invalidated sessions, and brought in GitHub to audit for token misuse.

What stayed safe

Defang does not store user passwords (users sign in with GitHub, GitLab, or emailed codes), does not hold direct customer cloud credentials for BYOC deployments, does not store repository source code in its database, and does not have access to full payment card numbers or security codes (which remain strictly inside Stripe). Defang had already stopped saving deployment-state copies on Nov 19 and deleted the stored copies.

How to defend against this

Lock tags with tag rulesets

Protect release tags with GitHub tag rulesets so dev Apps and bots cannot push tags, and isolate dev/test GitHub Apps strictly to sandbox repos with zero environment write scopes.

Bind prod secrets to branches

Restrict production GitHub Environments to protected branches with mandatory human reviewers instead of releasing production secrets on arbitrary tag pushes.

Pin OIDC role to deploy branch

Pin AWS AssumeRoleWithWebIdentity trust policies on defang-cd-CIRole to your exact deploy branch or protected environment sub claim, and alert on defang-app[bot] workflow edits.

protect-release-tags.json

GitHub tag ruleset blocking dev bots and Apps from pushing or altering release tags. Stops step 1.

{  "name": "lock-release-tags",  "target": "tag",  "enforcement": "active",  "conditions": {    "ref_name": { "include": ["refs/tags/v*"] }  },  "rules": [    { "type": "creation" },    { "type": "update" },    { "type": "deletion" }  ]}

Appendix

Evidence log: what’s confirmed and what’s withheld5 claims
ClaimStatusSource
An internal dev/test GitHub App installed on two repos with excess permissions pushed a commit and release tag on Nov 12, triggering dev/staging (06:05 UTC) and production (06:26 UTC) CI with live credentialsConfirmedDefang security incident report, Nov 24, 2026
How the attacker originally obtained the dev/test GitHub App keyWithheld by vendorDefang security incident report (not established)
Main database copied 07:57–08:10 UTC (Portal users, repo names, cloud IDs, Compose files, and Oct 12–Nov 19 deployment state with DB passwords), plus live Stripe key, Defang GitHub App key, and token encryption key valid until Nov 23ConfirmedDefang security incident report, Nov 24, 2026
Indirect downstream risk that the stolen Defang GitHub App key could trigger customer workflows assuming admin OIDC deploy roles such as AWS defang-cd-CIRole (post-Nov 12 misuse audit ongoing with GitHub)InferredDefang security incident report, Nov 24, 2026
User passwords (none stored), direct customer BYOC cloud credentials, repository contents, and full card numbers and security codes (held by Stripe) were not exposedConfirmedDefang security incident report, Nov 24, 2026
Indicators of compromise2 indicators
  • defang-app[bot] commits, workflow edits, or tag pushes (Nov 11–23, 2026)

    GitHub security and org audit log identity customers should audit per Defang’s Nov 24 notice.

  • AssumeRoleWithWebIdentity on defang-cd-CIRole (Nov 11–23, 2026)

    AWS CloudTrail event (plus GCP workload identity / Azure managed identity logs) to audit for unauthorized downstream deploys.

Reproduction labMarkdown playbook, MIT license

Checks GitHub workflow files for tag triggers wired to production environments and checks customer repositories for unexpected defang-app[bot] activity since Nov 11.

Safety note: Read-only repository and CloudTrail inspection only.

# check if any workflow triggers on tag pushes alongside a production environment
grep -rnE "tags:|environment:\s*production" .github/workflows/ || true
Defang: an over-privileged dev GitHub App tagged a release and copied production | breachidents