Defang 安全事件
Defang Security Incident

原始链接: https://defang.io/blog/post/security-incident-november-2026/

2026年11月12日,攻击者通过一个开发用 GitHub 应用攻陷了 Defang 的构建系统,获取了生产凭据并复制了主数据库。2026年11月23日确认。泄露的数据包括 Portal 用户的姓名/邮箱、GitHub/GitLab 用户名和组织、注册回答、已连接的云账户 ID/区域、Compose 文件,以及 10月12日至11月19日期间的部署状态,其中可能包含数据库密码或密钥。如果已安装 Defang GitHub 应用,其密钥和 GitHub 登录令牌可进行仓库及云部署角色操作,直至 11月23日被更换;账单数据泄露了卡元数据但未泄露完整卡号。密码、云凭据、仓库内容和配置值未被泄露。Defang 已更换凭据、吊销令牌、删除部署状态副本并通知用户。用户应检查仓库/云活动、锁定部署环境、吊销/重新连接应用、若在 10月12日至11月19日期间部署过则更改密码/密钥,并警惕钓鱼。可疑活动请报告至 [email protected]。

Hacker News 讨论了 Defang 的一起安全事件。攻击者利用一个安装在两个 Defang 仓库上的、权限过高的独立 GitHub App 推送提交并将其标记为发布。由于生产环境信任发布标签,攻击者代码在 CI 中以生产凭据运行,导致这些凭据被盗,Defang 主数据库也被复制。安装了 Defang GitHub App 的用户可能面临广泛的仓库访问风险,包括提交、工作流变更、密钥、环境、拉取请求和设置。计费客户可能暴露姓名、邮箱、地址、税号、卡信息和发票历史。评论指出漏洞窗口为 11 月 12 日至 23 日,质疑审计与检测,并强调对 Defang 和客户都有严重影响。
相关文章

原文

On November 12, 2026 an attacker copied the credentials we use to run Defang and downloaded a copy of our main database. Here is what happened, what was exposed, what we have done, and what you should do.

On November 12, 2026 an attacker got into the Defang Deploy build system and copied the credentials we use to run Defang. With those they downloaded a copy of our main database. We confirmed this on November 23, 2026. If you have a Defang Portal account, your account is in that database, and this post explains what was taken and what you should do. We are also writing to every affected user by email.

If you installed the Defang GitHub App, some of those credentials could also be used against your GitHub repositories and your cloud account. We have replaced them, but there are checks only you can do. They are listed under "What you should do" below. Please go through them as soon as you can.

What happened

We used a separate GitHub App for local development and testing. It was installed on two of our own repositories and had more permissions than it needed, including permission to change deployment environments. Acting as that app, the attacker pushed a commit to one of those repositories and tagged it as a release. Our production environment trusted release tags, so their code ran in our CI with access to our production credentials, and the attacker copied them.

The activity we can see ran from about 06:00 to 10:30 UTC on November 12. The credentials stayed valid until we replaced them on November 23. We are still checking whether they were used after November 12. Some of our logs are not detailed enough to rule that out, so we will update this post when we know more.

Timeline

All times are UTC.

  • November 12, 06:05: the first workflow that copied build credentials ran, against our development and staging environments.
  • November 12, 06:26: our production credentials were copied.
  • November 12, 07:57 to 08:10: the database was copied.
  • November 15: we were made aware of a security issue with a dependency and installed the update.
  • November 23: a routine security scan found suspicious activity in our repositories.
  • November 23: we confirmed the database copy from our access logs, replaced our production credentials and emailed every affected user.
  • November 24: we published this post.

What the attacker could see

  • Your name and email address. This is the address only: the attacker did not get into your email account or see any of your messages.
  • Your GitHub or GitLab username, and the names of the organizations that account belongs to
  • The answers you gave when you signed up
  • If you installed the Defang GitHub App: the names of the repositories it can access, including private ones
  • The cloud accounts you connected to Defang (account, project or subscription IDs and regions; no credentials)
  • The Compose files you deployed or generated with Defang
  • Copies of deployment state from deploys between October 12 and November 19. These can include database passwords and any environment variable built from a defang config value, such as a database URL that contains a password.

If you installed the Defang GitHub App: what the attacker could use

The attacker could use the Defang GitHub App's key, and the GitHub sign-in token we keep when you connect GitHub. The token was stored encrypted, but the encryption key was taken too. Until we replaced them on November 23, anyone holding these could do in your repositories what the app is allowed to do:

  • push commits and branches
  • change workflow files and start workflow runs
  • overwrite Actions secrets and variables
  • change deployment environments and their protection rules
  • open and merge pull requests
  • change repository settings, including branch protection, deploy keys and collaborators

A workflow run started this way can receive your cloud credentials, because the role Defang set up for GitHub deploys trusts workflows in your repository.

If you have billing details with us

The copied credentials included a key for our account at Stripe, our payment provider. Until we replaced it on November 23, someone holding that key could read the record Stripe keeps for you:

  • your name and email address
  • your billing address, or the parts of it you gave us, and your tax ID if you entered one
  • the brand, last four digits and expiry date of your card
  • your subscription and invoice history

Your full card number and security code were not exposed. Stripe holds those and does not make them available to Defang or to anyone using our key.

What was not exposed

  • Passwords. Defang has none for you: you sign in with GitHub, GitLab or an emailed code.
  • Your cloud credentials. We never hold them. Your BYOC deployments run in your own account with your own credentials, and Defang's servers have no direct access to that account or to anything running in it. The one indirect path is the GitHub Actions deploy role described above.
  • The contents of your repositories. They are not stored in our database.
  • Config values you set with defang config. They stay in your cloud account, except for the copies in deployment state described above.

What we have done

  1. Replaced the Defang GitHub App key and secrets on November 23, and revoked the GitHub sign-in tokens we held.
  2. Replaced our other production credentials, including database, payment and email credentials, on November 23.
  3. Signed out every session and invalidated every Defang access token issued before November 23.
  4. Stopped keeping copies of deployment state on November 19 and deleted the copies we had.
  5. Cancelled every pending cloud invite link. If you were inviting someone, send a new invite.
  6. Notified GitHub, who are helping us audit for token misuse.
  7. Installed the security update on November 15.
  8. Revoked the development GitHub App's credentials and suspended the app on November 23.
  9. Reverted the production and staging deployment configurations that were altered by the attacker.
  10. Notified users and relevant authorities of the data breach.

What you should do

Everyone

  • Be careful with email that claims to come from Defang, GitHub or GitLab, especially anything that asks you to sign in, approve an app or share a code. Someone holding this data can write a convincing message that uses your real name and username. We will never ask you for a password or a token by email.
  • You will need to sign in to Defang again.

If you installed the Defang GitHub App: in GitHub

  1. Check your connected repositories for activity you don't recognize since November 11:
    • new commits, branches or tags
    • changes under .github/workflows
    • workflow runs you didn't start
    • changed Actions secrets or variables
    • new deploy keys or collaborators, and changed branch protection rules
  2. Look in particular at anything from defang-app[bot]. Your security log is at github.com/settings/security-log; organizations have an audit log under Settings.
  3. Lock down the deployment environments Defang created. In each connected repository, open Settings, then Environments. For every environment whose name starts with defang-, set "Deployment branches and tags" to your deploy branch only. You can also add required reviewers. This stops a workflow on any other branch from receiving your cloud credentials.
  4. Revoke and reconnect Defang's access to your GitHub account. In GitHub, go to Settings, then Applications, then Authorized GitHub Apps, and revoke Defang. Sign in to Defang again afterwards.
  5. If you no longer deploy from GitHub with Defang, uninstall the Defang app from your account or organization.

If you deploy from GitHub Actions: in your cloud account

  1. Check who has used your deploy role since November 11. The role or identity Defang set up for GitHub deploys has administrator access to your account. A token from a branch or workflow you don't deploy from is a sign of misuse.
    • On AWS this is usually defang-cd-CIRole. Search CloudTrail for AssumeRoleWithWebIdentity calls on it.
    • On Google Cloud, check the workload identity pool's token exchanges.
    • On Azure, check the sign-in logs for the managed identity.
  2. Narrow that role's trust to the branch or environment you deploy from, if it currently allows any branch.

If you deployed with Defang between October 12 and November 19

  1. Change your database passwords and any secret that was part of another environment variable, then redeploy. Use defang config set <NAME> for each one.
  2. If your Compose file has secrets written directly in it, change those too.

If you have billing details with us

You do not need to replace your card. The exposed details are not enough to charge it. Watch your statements as you normally would, and be wary of email or calls that quote your last four digits or billing address to appear legitimate.

If any of these checks turns up something you don't recognize

Rotate the secrets in that repository's Actions secrets and environments and the cloud credentials its workflows can reach, then tell us.

Frequently asked questions

Was my GitHub password exposed? Do I need to change it right away?

No. Defang never had your GitHub password. You sign in with GitHub, GitLab or an emailed code, so there is no password for us to lose.

What the attacker could use was the Defang GitHub App's key and the GitHub sign-in token we keep when you connect GitHub. We replaced the key and revoked those tokens on November 23. Changing your GitHub password is not required, but it does no harm, and turning on two-factor authentication is a good idea in any case. The checks that matter are the ones under "If you installed the Defang GitHub App: in GitHub" above: look for activity you don't recognize, lock down deployment environments, and revoke the Defang GitHub App.

Did they take only my information from GitHub, or did they go further? Did they get my email?

They got your email address, but not your email account. The address we have on file for you is in our database, so it was copied. Defang has no access to your mailbox, so the attacker could not read your email or sign in to your email account through us.

From GitHub, what we hold is your username, the names of the organizations your account belongs to and, if you installed the Defang GitHub App, the names of the repositories it can access. The contents of your repositories are not in our database.

If you installed the Defang GitHub App, the attacker also held the credentials that let them act in your repositories until we replaced them on November 23. We are still checking whether they were used after November 12, and we will update this post when we know more. That is why we ask you to review your repositories and your cloud account. "What the attacker could see" and "What the attacker could use" above list everything.

Did this happen only to me, or to all users?

Anyone with a Defang Portal account is in the database that was copied, so your email address, and potentially your name, was exposed along with everyone else's. Beyond that, what was exposed depends on how you use Defang. See above section for details.

How can I protect my data? How do I check that an email really comes from you?

  • Don't sign in, approve an app or share a code because an email asked you to. Open the Defang Portal, GitHub or GitLab yourself by typing the address in your browser, rather than following a link in a message.
  • We will never ask you for a password or a token by email.
  • Someone holding this data can quote your real name, username or the organizations you belong to. A message that knows those details is not proof that it comes from us.
  • If you are unsure about a message, forward it to [email protected] and we will tell you whether we sent it.
  • Work through the checklist in "What you should do" above. In short: review your repositories, review your cloud account, change database passwords and secrets if you deployed between October 12 and November 19, and turn on two-factor authentication on your GitHub and cloud accounts.

How do I delete my account and data?

Open Settings in the Defang Portal and delete your account there, or email [email protected] and we will do it for you.

Contact us

If you find anything suspicious, or want an engineer to go through your account, repositories or cloud account with you, write to [email protected]. We will update this post as we learn more.

The Defang Team

联系我们 contact @ memedata.com