# Starjacking

> Starjacking is pointing a package's repository metadata at a popular GitHub project it doesn't control, so registries show that project's stars as its own.

Also known as: Star jacking, CAPEC-693, Fake GitHub stars

Source: https://socket.dev/glossary/starjacking

Last updated: 2026-11-09

Starjacking is a package impersonation technique where a publisher points a package's repository metadata at a popular GitHub project it does not control, so registries display that project's stars and activity as the package's own. Also written StarJacking (CAPEC-693), it works because the `repository` field is self-asserted and most registries never verify it.

A GitHub star belongs to a repository, not to a package. A registry that shows stars next to a package is joining two records, and on npm and most other registries that join rests on a URL the uploader typed into a manifest. Fake GitHub stars attack the same signal from the other side: instead of borrowing a real repository's count, the attacker buys a count for their own. [Our research](https://socket.dev/blog/3-7-million-fake-github-stars-a-growing-threat-linked-to-scams-and-malware) found 3,746,538 suspected fake stars on GitHub between July 2019 and July 2024. Our position is simple. Stars are an unverified claim. The only repository link worth trusting is one bound to the build by provenance, and even that link says where a package was built, not what it does. Decide on what the package contains.

## What is starjacking?

Starjacking is borrowing another project's GitHub reputation by naming its repository in your package's metadata. The term comes from an [April 19, 2022 disclosure](https://checkmarx.com/blog/starjacking-making-your-new-open-source-package-popular-in-a-snap/) by Tzachi Zornstein at Checkmarx, which MITRE later catalogued as CAPEC-693. Zornstein put the root cause in one line: "The problem is that there is no validation of the connection between the package and the repository."

Starjacking rarely stands alone. It is the third leg of an impersonation kit whose other two legs are a lookalike name ([typosquatting](https://socket.dev/glossary/typosquatting) or combosquatting) and a README copied from the original. Each leg covers a different glance: the name passes the install command, the README passes the package page, and the borrowed repository passes the "is this project real?" check. The disclosure's own example was `pampyio`, a copy of the legitimate `pampy` whose dependency exfiltrated environment variables.

The same disclosure measured how ambiguous repository links already were. 3.03% of PyPI packages and 7.23% of npm packages shared a Git repository reference with at least one other package. Plenty of those are legitimate monorepos, which is exactly why a shared link alone cannot convict a package.

## The repository field is a free-text claim

A package's repository link is a field the publisher writes and the registry stores verbatim. On npm it is `repository` in [package.json](https://socket.dev/glossary/package-json). On the [Python Package Index (PyPI)](https://socket.dev/glossary/python-package-index-pypi) it is `project_urls` in the core metadata, set from `[project.urls]` in `pyproject.toml`. Neither format has a way to say "and I control this repository."

The field exists for convenience. `npm repo`, `npm bugs`, and the "Repository" or "Source" link on a package page all read it. It was designed as a pointer for humans and tools, not as an identity claim, and registries later started rendering popularity data next to it.

Here is a package that claims React's repository. npm accepts it without a check:

```json
{
  "name": "starjack-demo",
  "version": "1.0.0",
  "description": "String left pad",
  "repository": { "type": "git", "url": "git+https://github.com/facebook/react.git" },
  "homepage": "https://github.com/facebook/react#readme"
}
```

```bash
$ npm publish --dry-run
npm notice package: starjack-demo@1.0.0
...
npm warn This command requires you to be logged in to https://registry.npmjs.org/ (dry-run)
npm notice Publishing to https://registry.npmjs.org/ with tag latest and default access (dry-run)
+ starjack-demo@1.0.0
```

We ran this with npm 10.9.9. The publish path validates the name, the version, and the tarball. It never asks GitHub who owns `facebook/react`. After a real publish, the registry serves the claim back to every client as data, indistinguishable from an honest one:

```bash
$ curl -s https://registry.npmjs.org/node-telegram-bot-api | jq .repository
{
  "url": "git+https://github.com/yagop/node-telegram-bot-api.git",
  "type": "git"
}
```

That object belongs to the legitimate package. A starjacked copy can carry a byte-identical one.

## How does starjacking show up in real attacks?

Starjacking shows up as the credibility layer on otherwise ordinary [malicious packages](https://socket.dev/glossary/malicious-package). Two cases from our research show the pattern.

In February 2024 we analyzed [noblox.js-proxy-server](https://socket.dev/blog/malicious-npm-package-masquerades-as-noblox-js), a combosquat of the Roblox API wrapper `noblox.js`. Version 4.15.4 pointed its GitHub repository URL at the legitimate project. Its obfuscated `postinstall.js` zipped Roblox game files, uploaded them to Gofile, reported to a Discord webhook, and fetched a batch script that downloaded a Windows executable.

In April 2025 we found [three typosquats of node-telegram-bot-api](https://socket.dev/blog/npm-malware-targets-telegram-bot-developers): `node-telegram-utils`, `node-telegram-bots-api`, and `node-telegram-util`. They copied the real README and pointed their homepage at the real repository, borrowing its star count. On Linux, the library's constructor silently appended two attacker SSH keys to `~/.ssh/authorized_keys`, then sent the host's external IP and username to the attacker. Removing the package does not remove the keys.

The three packages collected about 300 downloads combined. Starjacking does not need scale. It needs one developer who checks the page, sees a real project behind it, and installs.

> Only registry-recorded fields tell the two pages apart. Self-asserted fields are copied, and GitHub data follows the copied link.
>
> A legitimate npm package page next to a starjacked copy. Registry-recorded fields differ; self-asserted and borrowed fields are identical.

The figure above compares the legitimate `node-telegram-bot-api` page with the starjacked `node-telegram-utils` page, field by field. The package name and the download count come from the registry's own records, and they are the only fields that differ: 4.2 million-plus downloads for the original against about 300 for all three typosquats combined. The README and the homepage are self-asserted by the publisher, so the copy reproduces them exactly, down to the same `github.com/yagop/node-telegram-bot-api` link. Stars and issue counts, wherever a registry or scoring tool renders them, are fetched live from whichever GitHub repository the self-asserted link names, so both pages show `yagop/node-telegram-bot-api`'s numbers. A reviewer who judges the page by its repository panel is reading the attacker's input.

## PyPI verifies the link, npm binds it with provenance

Registries responded to starjacking in two ways: stop rendering borrowed numbers, or verify the link before rendering it. A [November 2024 survey of 21 registries](https://checkmarx.com/blog/falling-stars/), from the same research team, found that Yarn's site had removed GitHub statistics entirely, while npm still showed issue and pull request counts from the linked repository.

PyPI took the verification route. In October 2023, warehouse PR #14657 started using Trusted Publishing to shape the sidebar, citing CAPEC-693 directly. On August 21, 2024, [PR #16532](https://github.com/pypi/warehouse/pull/16532) went further: GitHub statistics now render only inside "Verified details," and not at all without a verified repository URL.

Verification on PyPI rides on [Trusted Publishing](https://socket.dev/glossary/npm-trusted-publishing). A release uploaded from GitHub Actions has the GitHub URLs for that workflow's repository marked as verified. PyPI's [documentation](https://docs.pypi.org/project_metadata/) is careful about what that buys: "Verification only attests that the PyPI package owner controlled the URL at the time of upload." The stars themselves are still fetched live from GitHub, and PyPI does not check them.

npm's equivalent is [package provenance](https://socket.dev/glossary/package-provenance). When a package is published with a Sigstore-signed provenance statement, the registry checks that `repository.url` in the uploaded package.json matches the Source Repository URI in the signing certificate ([npm/provenance](https://github.com/npm/provenance)). The binding is public and checkable. Here is the provenance for `sigstore@5.0.1`, fetched from the registry's attestations endpoint and decoded:

```bash
$ curl -s https://registry.npmjs.org/-/npm/v1/attestations/sigstore@5.0.1 \
  | jq -r '.attestations[] | select(.predicateType=="https://slsa.dev/provenance/v1")
           | .bundle.dsseEnvelope.payload' | base64 -d \
  | jq '.predicate.buildDefinition | {workflow: .externalParameters.workflow,
        commit: .resolvedDependencies[0].digest.gitCommit}'
{
  "workflow": {
    "ref": "refs/heads/main",
    "repository": "https://github.com/sigstore/sigstore-js",
    "path": ".github/workflows/release.yml"
  },
  "commit": "4576519f81b93bf96bd7457fc7252b8cfa11e67f"
}
```

PyPI exposes the same fact through its Integrity API:

```bash
$ curl -s -H "Accept: application/vnd.pypi.integrity.v1+json" \
  https://pypi.org/integrity/sigstore/4.5.1/sigstore-4.5.1-py3-none-any.whl/provenance \
  | jq -c '.attestation_bundles[].publisher'
{"environment":null,"kind":"GitHub","repository":"sigstore/sigstore-python","workflow":"release.yml"}
```

A starjacked package cannot produce either record for a repository it does not control, because it cannot run a workflow there. The check is mechanical. A package that claims a repository and has no provenance makes an unverified claim. A package with provenance can be checked by comparing the two.

| Signal | Who asserts it | Checked against | Stops starjacking? | Stops fake stars? | Stops a compromised pipeline? |
| --- | --- | --- | --- | --- | --- |
| repository / project\_urls field | Publisher | Nothing | No | No | No |
| PyPI verified URL | PyPI, at upload | Trusted Publisher identity | Yes, on PyPI | No | No |
| npm provenance | Registry, at publish | Sigstore certificate from CI | Yes, when present | No | No |
| Stargazer behavior analysis | Third party or platform | Who starred, and when | No | Partly | No |
| Package content analysis | Analyzer | The code in the tarball | Catches the payload | Catches the payload | Catches the payload |

Verdict: use provenance or PyPI's verified details to answer "is this package really from that repository?" Use stargazer analysis to discount a repository's popularity. Neither tells you whether the code is safe. In the [TanStack compromise](https://socket.dev/blog/tanstack-npm-packages-compromised-mini-shai-hulud-supply-chain-attack), the implant was built to submit Sigstore provenance for the versions it published. Code running inside GitHub Actions can generate valid attestations for malicious packages. Attackers who [compromise a maintainer](https://socket.dev/glossary/maintainer-account-takeover) or a pipeline publish through legitimate infrastructure, and provenance faithfully records that rather than preventing it. Only reading what the tarball does addresses all three columns.

## How are fake GitHub stars different from starjacking?

Fake GitHub stars inflate a repository's own count with purchased or automated stars, while starjacking borrows a count that is real. Starjacking needs a registry or tool that renders unverified links. Fake stars need nothing but GitHub accounts, and they work on the repository page itself, on trending lists, and in every tool that ranks by stars.

The market is cheap. [Our 2024 research](https://socket.dev/blog/3-7-million-fake-github-stars-a-growing-threat-linked-to-scams-and-malware) found stars sold for as little as $0.10 each. Across July 2019 to July 2024 we flagged 10,155 repositories that appeared to run a fake star campaign. About 89% had been deleted by the time we published, for reasons GitHub does not disclose. Of those still online, VirusTotal reported malware in 28. One example, [Solmonster/PhantomSniper-Solana-Sniper-Bot](https://socket.dev/blog/3-7-million-fake-github-stars-a-growing-threat-linked-to-scams-and-malware), had 109 suspected fake stars and a polished README, and stole cryptocurrency through a hidden `spawn()` call.

The expanded study, [Six Million (Suspected) Fake Stars on GitHub](https://arxiv.org/abs/2412.13459), extends the window to December 2024 and appeared at ICSE 2026. Its StarScout detector found about 6.0 million suspected fake stars before filtering, and 18,617 campaign repositories involving roughly 301,000 accounts after it. Sellers usually deliver stars in batches of 50 or 100. In July 2024, 16.66% of repositories that received at least 50 stars that month had a fake star campaign. By the study's measurement, 90.42% of campaign repositories had been deleted, against a 5.03% baseline.

The study also measured whether buying stars works. It does, briefly. Fake stars correlate with a small rise in real stars for less than two months, then with a decline. The buyers who benefit most are the ones who only need a few weeks: malware repositories disguised as game cheats, pirated software, and crypto bots.

## How are fake stars detected?

Fake stars are detected from the behavior of the accounts that give them, not from the repository. Real users star repositories in scattered, uncorrelated patterns. Star sellers have to deliver hundreds of stars fast from a limited pool of accounts, and that business model leaves two signatures.

**Low activity.** Some sellers register throwaway accounts whose entire public history is starring one repository, plus at most one other event on that repository the same day. Here is a simplified sketch of that check against the GH Archive event dataset in BigQuery, counting single-event stargazers per repository for one day:

```sql
-- Simplified low-activity signal: accounts whose only public event
-- that day was one WatchEvent (a star). Real detectors check the
-- account's whole history, not one day.
WITH day AS (
  SELECT actor.login AS who, repo.name AS repo, type
  FROM `githubarchive.day.20240701`
),
single AS (
  SELECT who FROM day GROUP BY who
  HAVING COUNT(*) = 1 AND LOGICAL_AND(type = 'WatchEvent')
)
SELECT repo, COUNT(*) AS throwaway_stars
FROM day JOIN single USING (who)
GROUP BY repo
HAVING throwaway_stars >= 50
ORDER BY throwaway_stars DESC;
```

**Lockstep.** Other sellers reuse a pool of accounts across many customers. The same group of N accounts stars the same group of M repositories inside a short window. Finding those groups is a maximal biclique search, which is NP-complete, so both our detector and StarScout reimplement CopyCatch, the algorithm Facebook built to catch fake likes, over GH Archive's roughly 20 TiB of events.

> Lockstep campaigns form complete account-by-repository blocks inside a short window. Organic stars do not.
>
> Organic starring versus a lockstep fake star campaign, drawn as account-to-repository graphs.

The figure above is an illustrative contrast between organic starring and a lockstep campaign. In the organic panel, five accounts give six stars to four repositories between March and August: account 1 stars repo A in March, account 2 stars repo B in May and repo D in July, account 3 stars repo C in April, account 4 stars repo A in June, and account 5 stars repo D in August. No two accounts share more than one repository. In the lockstep panel, all five accounts star all four repositories on July 1 between 14:00 and 16:00 UTC, forming a complete bipartite block of 20 edges. Real users almost never produce that block, which is why one shared burst across several unrelated repositories is strong evidence of a shared account pool.

Both heuristics produce false positives, because star sellers deliberately star popular legitimate repositories as cover. That is why detectors only label a repository when its suspected fake stars arrive as a burst, and why a few suspicious stars on a large project mean little.

Outside detection got harder in 2026. GitHub [announced on June 30, 2026](https://github.blog/changelog/2026-06-30-upcoming-access-restrictions-to-public-api-endpoints-and-ui-views/) that its stargazer listing endpoints would be restricted to repository admins and collaborators, saying the data "has increasingly been misused to collect user data for spam activities." Its replacement star history endpoint returns daily counts with no identities. As of November 2026, an outside observer using GitHub's API can see a burst but not who caused it, so the account-level heuristics above depend on public event archives or on GitHub itself.

Socket flags both halves of this problem. The Suspicious Stars on GitHub alert ([`suspiciousStarActivity`](https://socket.dev/alerts/suspiciousStarActivity)) applies the low-activity and clustering heuristics to a package's GitHub repository, at high severity. It is not in Socket's default security policy, so teams have to enable it. The AI-detected possible typosquat alert ([`gptDidYouMean`](https://socket.dev/alerts/gptDidYouMean)) targets the rest of the starjacking kit: a package mimicking another package's name, description, or other metadata. Neither replaces reading the code. A starjacked package that ships a credential stealer is caught by what its code does, not by whose repository it names.

## Why popularity metadata keeps failing

Starjacking and fake stars are the same mistake made twice: a registry or a reader treats a number from someone else's system as evidence about this package. The number is cheap to borrow, cheap to buy, and it was never designed to be a security control. Goodhart's law predicts the rest: once stars drive decisions, people manufacture stars.

PyPI showed the fix for the borrowed half. Render repository statistics only when the repository is cryptographically bound to the upload, and say plainly what that binding does not prove. We think npm should adopt the same rule for the GitHub-derived counts it rendered from unverified links in that 2024 survey. Showing them only for packages with provenance would stop npm's own pages from lending a stranger's activity to a starjacked package, at no cost to publishers who already use trusted publishing.

The bought half has no registry fix. A package with genuine provenance whose repository bought 5,000 stars is a real project with fake popularity. Its repository can still be lost to [repojacking](https://socket.dev/glossary/repojacking) tomorrow, or compromised through its own CI. The open problem is that the industry still ranks, trends, and funds projects on a metric that costs ten cents to fake, and as of November 2026 the platform that hosts it has made that metric harder for outsiders to audit.
