Your ticks and choices are saved in this browser only.
Your GitHub account
Whoever controls your GitHub account controls what every user of your app installs next. Nothing in the repository can protect against a stolen login.
Controls
ACC-1Level 1Turn on two-factor login with a passkey or a security key.
Why A common way to take over an account is a page that looks like a real login. A password and an authenticator code work on any site you type them into, and a lookalike can pass them straight on to the real one. A passkey or security key only works on the site it was made for. In 2025, phishing like this was used to publish malware from maintainers' accounts on both PyPI and npm (how it happened).
Settings → Password and authentication. An authenticator app is fine as a second method. Avoid SMS. Store the recovery codes somewhere offline.
ACC-2Level 1Replace classic personal access tokens with fine-grained ones.
Why A token works for anyone who has a copy, with no password or 2FA, and copies end up in CI secrets,
.envfiles and old laptops. A classic token can act on every repository you can reach and never expires. A fine-grained one only reaches the repository and permissions you gave it, until its expiry date. The Shai-Hulud worm collected tokens like these from developers' machines and CI in 2025 (how it happened).Settings → Developer settings → Personal access tokens. Give each token one repository, only the permissions it needs, and an expiry date. Delete tokens you no longer use.
ACC-3Level 1Review what can act for you.
Why Every OAuth app, GitHub App, SSH key and signed-in session can act for you without your password, and each is another way into your account. Some were probably added years ago for something you no longer use. After the Shai-Hulud worm, CISA's advice included removing the GitHub Apps and OAuth apps you don't need (how it happened).
Settings → Applications (OAuth apps and GitHub Apps), SSH keys, and Sessions. Remove anything you don't recognize or no longer use.
ACC-4Level 2Level markerSign your commits.
Why Git lets anyone put any name and email on a commit. A signature can't be made without your key, so signed commits let people tell your work from a commit pushed with a stolen token or written to look like yours. In 2021, two malicious commits were pushed to PHP's source code in the names of two of its core developers (PHP's announcement).
An SSH key is the simplest way. You can use the one you already push with.
- If you don't have an SSH key, run
ssh-keygen -t ed25519. It saves the public half as~/.ssh/id_ed25519.pub. - Tell Git to sign every commit and tag with it.Change the path if your key has a different name.Terminal
git config --global gpg.format ssh git config --global user.signingkey ~/.ssh/id_ed25519.pub git config --global commit.gpgsign true git config --global tag.gpgsign true
- Give GitHub the public key, so it can check your signatures. Until you do, your signed commits show "Unverified". In Settings → SSH and GPG keys, choose New SSH key, set Key type to Signing Key, and paste the line that
cat ~/.ssh/id_ed25519.pubprints. Only share the file ending in.pub. The one without.pubis your private key. From a terminal, the GitHub CLI can do it instead:A key you already added for pushing has to be added again as a signing key.Terminalgh auth refresh -h github.com -s admin:ssh_signing_key gh ssh-key add ~/.ssh/id_ed25519.pub --type signing --title "My laptop"
Where the private key is kept decides what someone gets if they copy your files or run code on your machine:
Where the key is Someone copies your files Malware runs as you Day to day A file with no passphrase They have your key Can sign Nothing to type A file with a passphrase, loaded into the SSH agent Useless without the passphrase Can sign while the key is loaded Unlock once per login. macOS can keep the passphrase in Keychain. A password manager's SSH agent There's no key file Asks before each app uses the key Approve each app A security key ( ssh-keygen -t ed25519-sk)The key never leaves the hardware Needs a touch for every signature A touch for every commit, so a rebase of 20 commits is 20 touches With a password manager, its own instructions give the value for
user.signingkey. GPG keys work too, with GitHub's GPG instructions.In a codespace you don't need a key of your own. Turn on Settings → Codespaces → GPG verification for the repositories you trust, and GitHub signs the commits you make there. Commits you make on GitHub's website are signed by GitHub already.
- If you don't have an SSH key, run
ACC-5Level 2Then turn on vigilant mode.
Why Signing only helps if an unsigned commit in your name stands out. Without vigilant mode, GitHub shows an unsigned commit with no label, like most commits. With it on, an unsigned commit in your name shows "Unverified".
On the same page, tick "Flag unsigned commits as unverified". Any commit with your name that you didn't sign then shows "Unverified", including one pushed with a stolen token. Wait until a commit you push shows "Verified", or your own commits show "Unverified" too.
ACC-6Level 2Give the project a second maintainer, or at least a plan.
Why When one person can publish, nobody notices an odd release from that account, and nobody can step in if that person loses access or moves on. If its maintainer leaves without a plan, a project can pass to whoever asks for it. In 2018, someone posing as a maintainer took over the event-stream package on npm and added code that stole from bitcoin wallets (how it happened).
A free GitHub organization lets several people share a project and can require two-factor login for all of them. Organizations covers when it's worth it. If you're on your own, write down in the README who can take over.
Check it worked
Settings → Password and authentication lists a passkey or security key. Settings → Developer settings shows no classic tokens. Your recent commits show "Verified".
Attacks on npm, PyPI and GitHub Actions
How six attacks on npm, PyPI and GitHub Actions worked, and which controls would have stopped them.
None of these attacks happened in the Home Assistant Marketplace, and the 2026 sweep found no malware there. The projects here were the victims, and several of them published detailed reports afterwards. Every fact on this page comes from those reports, the registry, GitHub or CISA, linked under each attack.
Phished logins on PyPI and npm, 2025
In July 2025, PyPI found a phishing campaign that sent package maintainers to pypj.org, a lookalike of pypi.org. Four accounts were phished. With one of them, the attacker created API tokens and uploaded two releases of num2words, 0.5.15 and 0.5.16, with malware in them. PyPI removed the releases and revoked the tokens. PyPI's report says the fake site worked as a proxy, so it could capture authenticator-app codes and session cookies as well as passwords. It recommends WebAuthn, meaning a passkey or a security key.
On September 8, 2025, the maintainer of debug, chalk and 16 other npm packages got a 2FA reset email from npmjs.help, which the maintainer later called "shockingly authentic". The npm account was taken over, and new versions such as debug 4.4.2 and chalk 5.6.1 were published with code that redirected cryptocurrency transactions in the browser to the attacker's addresses. npm removed them over the course of the day.
A lookalike site collects the password and the 2FA code.
ACC-1 A passkey or security key only signs in to the site it was made for, so it gives a lookalike nothing to pass on.
The attacker publishes new versions from the maintainer's account.
No control in the repository can stop a publish from the maintainer's own account. This step can only be prevented by ACC-1, in the step before.
Projects that use the package pick up the new version.
DEP-4 npm's versions were gone the same day, so with a 7-day cooldown Dependabot would never have offered them. DEP-3 With exact versions pinned, a new release only reaches your users through a pull request you merge.
Sources: PyPI's incident report, GitHub advisory GHSA-4x49-vf9v-38px, the maintainer's comment.
Shai-Hulud, a worm on npm, 2025
In September 2025, CISA warned of a self-replicating worm that had compromised more than 500 npm packages. Its install script collected GitHub personal access tokens and cloud keys for AWS, Google Cloud and Azure, sent them to the attacker and uploaded them to a public repository named Shai-Hulud. It then signed in to npm as the developer and published infected versions of their other packages, which spread it further. GitHub removed the packages. A second version, which GitHub described in December 2025, also registered infected machines as self-hosted runners and had what GitHub called "destructive functionality".
On December 9, 2025, npm revoked every classic token, limited write tokens to 90 days and made 2FA mandatory for publishing.
An infected version arrives through a dependency update.
DEP-4 A cooldown keeps it out while it's new. DEP-3 Exact pins mean it only arrives in a pull request.
Its install script collects every token it can find, on a laptop or in CI.
ACC-2 A fine-grained token only reaches the repositories and permissions it was given, and it expires. CI-7 A read-only workflow token can't push code or publish anything. SEC-4 With trusted publishing, CI holds no publishing token for the script to find.
It publishes as the developer and keeps whatever access it was given.
ACC-3 CISA's advice included removing the GitHub Apps and OAuth apps you don't need. It also recommended branch protection (BR-1), secret scanning (CI-3) and Dependabot security updates (CI-2).
Sources: CISA's alert, GitHub, September 2025, GitHub, December 2025, npm's token changes.
tj-actions/changed-files, a GitHub Action, March 2025
tj-actions/changed-files was used by over 23,000 repositories. In March 2025, several of its version tags were changed to point to a malicious commit. Workflows that used those tags ran code that read secrets from the runner's memory and printed them in the workflow log, where anyone could read them in a public repository. CISA says an earlier compromise of another action, reviewdog/action-setup, may have made it possible.
Someone with access moves the action's published tags to a new commit.
BR-4 REL-3 For anyone who publishes an action, a tag ruleset or immutable releases stop a published tag from moving.
Every workflow that names the action by tag runs the new code on its next run.
CI-10 A workflow pinned to a commit SHA keeps running the commit it was pinned to.
The code reads the secrets in the job.
CI-7 REL-2 If the job only has a read-only token and no publishing secrets, that's all the code can read.
Sources: GitHub advisory GHSA-mrrh-fwg8-r2c3 (CVE-2025-30066), CISA's alert.
Ultralytics, Nx and TanStack, 2024 to 2026
In December 2024, malicious releases of the Python package ultralytics (8.3.41 and 8.3.42) came out of the project's own release workflow, after an attacker got into its GitHub Actions workflows and poisoned the Actions cache used in the build. Two more (8.3.45 and 8.3.46) were uploaded with a PyPI API token that the workflow could still reach, left over from before the project moved to Trusted Publishing. PyPI's advice was to avoid pull_request_target and shared caches, use Trusted Publishing, and revoke tokens you don't use.
In August 2025, a workflow in the Nx project that checked pull request titles ran on pull_request_target and put the title straight into a shell command. A pull request with a crafted title ran commands with a read and write GitHub token. With it, the attacker pushed a branch that changed a script, started the publish workflow and took its npm token. Malicious versions were live for 4 hours on August 26. Their install script searched the machine for secrets, tried to use local AI tools such as Claude and Gemini, and uploaded what it found to a public GitHub repository.
In May 2026, a TanStack workflow that measured bundle size ran on pull_request_target and built the pull request's code. That code saved a poisoned package store into the Actions cache, under the key the release workflow restores on every push to main. When the release workflow next ran, the malware read its short-lived publishing token from the runner's memory and published 84 versions of 42 packages to npm through trusted publishing. "No npm tokens were stolen," TanStack's postmortem says. An outside researcher reported it 26 minutes after the first publish, and npm had removed all of them within about four and a half hours.
A workflow runs a stranger's pull request with the repository's own access.
CI-9 Never run a pull request's code in a
pull_request_targetworkflow. CI-8 Keep text like a pull request's title out ofrun:lines.The pull request's code reaches the release, through a token, a script or a shared cache.
CI-7 With a read-only default token, Nx's title-check workflow would have had nothing to push a branch with. REL-2 A release environment keeps publishing secrets away from other workflows.
The release goes out with the project's own credentials.
SEC-4 Trusted publishing leaves no token to steal. Ultralytics' second pair of releases used a token left over from before the move. It can't help once untrusted code runs inside the release job, which is what happened at TanStack. DEP-4 For projects that use these packages, a 7-day cooldown would have kept out Nx's and TanStack's versions, which were gone within hours.
Sources: PyPI's analysis of the Ultralytics attack, Nx's postmortem, TanStack's postmortem.
xz-utils, 2024
The release tarballs of xz-utils 5.6.0 and 5.6.1 contained a backdoor (CVE-2024-3094). The project's original maintainer wrote that they were created and signed by Jia Tan, and that the backdoor's files in the repository were harmless without the trigger code, which "was never included in the Git repository". So reading the repository wouldn't have shown the backdoor, because only the release files had all of it.
A release file is made by hand, outside CI.
REL-1 When a workflow builds the release from main and attests it, the release is the code in the repository, and anyone can check that with
gh attestation verify.Reviewers read the repository, and users install the release.
The 2026 sweep found 84 Marketplace apps whose release code differs from their repository.
Sources: CVE-2024-3094, the maintainer's page on the backdoor.
event-stream, 2018
npm's report says an attacker, "posing as a maintainer", took over maintainership of the event-stream package, and on September 9, 2018, added a new dependency, flatmap-stream, in version 3.3.6. Its code was written for one app, the Copay bitcoin wallet, and harvested account details and private keys from wallets holding more than 100 bitcoin or 1,000 bitcoin cash. Copay shipped it in versions 5.0.2 to 5.1.0. npm's security team heard about it on November 26, more than two months later.
A package changes hands.
DEP-2 Check who maintains a package before you add it. DEP-6 Replace packages nobody looks after. ACC-6 For your own project, plan who takes over if you step away.
A new dependency arrives in an update.
DEP-3 With exact pins, it only arrives in a pull request, where the new dependency is in the diff.
Source: npm's report.
# Your GitHub account Whoever controls your GitHub account controls what every user of your app installs next. Nothing in the repository can protect against a stolen login. Source: https://ha-barkley.github.io/security/controls/account/ From HASC, the Home Assistant Security Controls for integrations, cards and apps. A community catalog, not an official Home Assistant or Open Home Foundation project. Each control has an ID, cited as HASC-CI-4, and a level from 1 to 3. "Level marker" means anyone can check the control from outside the project, and levels are graded on those controls only. > **From the 2026 sweep.** Of the 137 accounts that publish five or more apps, 72 (52.6%) have only ever had one account publish releases. If that one login is stolen, there's no second maintainer to notice or step in. The [Marketplace report](https://ha-barkley.github.io/marketplace/2026/accounts-and-reach/) has more on this. ## Controls ### ACC-1: Turn on two-factor login with a passkey or a security key *Level 1* **Why:** A common way to take over an account is a page that looks like a real login. A password and an authenticator code work on any site you type them into, and a lookalike can pass them straight on to the real one. A passkey or security key only works on the site it was made for. In 2025, phishing like this was used to publish malware from maintainers' accounts on both PyPI and npm ([how it happened](https://ha-barkley.github.io/security/attacks/#phishing)). Settings → Password and authentication. An authenticator app is fine as a second method. Avoid SMS. Store the recovery codes somewhere offline. ### ACC-2: Replace classic personal access tokens with fine-grained ones *Level 1* **Why:** A token works for anyone who has a copy, with no password or 2FA, and copies end up in CI secrets, `.env` files and old laptops. A classic token can act on every repository you can reach and never expires. A fine-grained one only reaches the repository and permissions you gave it, until its expiry date. The Shai-Hulud worm collected tokens like these from developers' machines and CI in 2025 ([how it happened](https://ha-barkley.github.io/security/attacks/#shai-hulud)). Settings → Developer settings → Personal access tokens. Give each token one repository, only the permissions it needs, and an expiry date. Delete tokens you no longer use. ### ACC-3: Review what can act for you *Level 1* **Why:** Every OAuth app, GitHub App, SSH key and signed-in session can act for you without your password, and each is another way into your account. Some were probably added years ago for something you no longer use. After the Shai-Hulud worm, CISA's advice included removing the GitHub Apps and OAuth apps you don't need ([how it happened](https://ha-barkley.github.io/security/attacks/#shai-hulud)). Settings → Applications (OAuth apps and GitHub Apps), SSH keys, and Sessions. Remove anything you don't recognize or no longer use. ### ACC-4: Sign your commits *Level 2 · Level marker* **Why:** Git lets anyone put any name and email on a commit. A signature can't be made without your key, so signed commits let people tell your work from a commit pushed with a stolen token or written to look like yours. In 2021, two malicious commits were pushed to PHP's source code in the names of two of its core developers ([PHP's announcement](https://news-web.php.net/php.internals/113838)). An SSH key is the simplest way. You can use the one you already push with. 1. If you don't have an SSH key, run `ssh-keygen -t ed25519`. It saves the public half as `~/.ssh/id_ed25519.pub`. 2. Tell Git to sign every commit and tag with it. `Terminal` ``` git config --global gpg.format ssh git config --global user.signingkey ~/.ssh/id_ed25519.pub git config --global commit.gpgsign true git config --global tag.gpgsign true ``` Change the path if your key has a different name. 3. Give GitHub the public key, so it can check your signatures. Until you do, your signed commits show "Unverified". In Settings → SSH and GPG keys, choose New SSH key, set Key type to *Signing Key*, and paste the line that `cat ~/.ssh/id_ed25519.pub` prints. Only share the file ending in `.pub`. The one without `.pub` is your private key. From a terminal, the GitHub CLI can do it instead: `Terminal` ``` gh auth refresh -h github.com -s admin:ssh_signing_key gh ssh-key add ~/.ssh/id_ed25519.pub --type signing --title "My laptop" ``` A key you already added for pushing has to be added again as a signing key. Where the private key is kept decides what someone gets if they copy your files or run code on your machine: | Where the key is | Someone copies your files | Malware runs as you | Day to day | |-----------------------------------------------------|-----------------------------------|-----------------------------------|-------------------------------------------------------------------| | A file with no passphrase | They have your key | Can sign | Nothing to type | | A file with a passphrase, loaded into the SSH agent | Useless without the passphrase | Can sign while the key is loaded | Unlock once per login. macOS can keep the passphrase in Keychain. | | A password manager's SSH agent | There's no key file | Asks before each app uses the key | Approve each app | | A security key (`ssh-keygen -t ed25519-sk`) | The key never leaves the hardware | Needs a touch for every signature | A touch for every commit, so a rebase of 20 commits is 20 touches | With a password manager, its own instructions give the value for `user.signingkey`. GPG keys work too, with GitHub's GPG instructions. In a codespace you don't need a key of your own. Turn on Settings → Codespaces → GPG verification for the repositories you trust, and GitHub signs the commits you make there. Commits you make on GitHub's website are signed by GitHub already. ### ACC-5: Then turn on vigilant mode *Level 2* **Why:** Signing only helps if an unsigned commit in your name stands out. Without vigilant mode, GitHub shows an unsigned commit with no label, like most commits. With it on, an unsigned commit in your name shows "Unverified". On the same page, tick "Flag unsigned commits as unverified". Any commit with your name that you didn't sign then shows "Unverified", including one pushed with a stolen token. Wait until a commit you push shows "Verified", or your own commits show "Unverified" too. ### ACC-6: Give the project a second maintainer, or at least a plan *Level 2* **Why:** When one person can publish, nobody notices an odd release from that account, and nobody can step in if that person loses access or moves on. If its maintainer leaves without a plan, a project can pass to whoever asks for it. In 2018, someone posing as a maintainer took over the event-stream package on npm and added code that stole from bitcoin wallets ([how it happened](https://ha-barkley.github.io/security/attacks/#event-stream)). A free GitHub organization lets several people share a project and can require two-factor login for all of them. [Organizations](https://ha-barkley.github.io/security/controls/organizations/) covers when it's worth it. If you're on your own, write down in the README who can take over. ### Check it worked Settings → Password and authentication lists a passkey or security key. Settings → Developer settings shows no classic tokens. Your recent commits show "Verified". Barkley shows who has published an app's releases and flags a release from a new publisher. It can't see how an account is protected.