Short answer: the public malware feeds show very little Java malware right now. When we pulled them at 18:10 UTC on 25 November 2026, the GitHub Advisory Database listed two malware advisories for the Maven ecosystem in total, and OSV held the same two MAL- records. Neither is new: OSV first published them in March and November 2025, and GitHub imported both in July 2026. That is a statement about what has been reported, not proof that Java builds are safe. To check live, watch the GitHub malware filter for Maven, the OSV Maven list and the OpenSSF malicious-packages repository, then run osv-scanner on every build.
The rest of this page covers what those two advisories say, where Java supply chain attacks tend to land instead (build plugins, Gradle plugins, repository order and internal groupIds), and the exact commands to check a project, a developer laptop and a CI runner today.
Key takeaways
- Two reported malicious Maven packages, both from 2025 (GitHub and OSV, 25 November 2026, 18:10 UTC).
io.github.leetcrunch:scribejava-core(an OAuth library typosquat) andorg.mvnpm:posthog-node4.18.1 (an npm package caught in the Sha1-Hulud worm, republished as a Maven artifact). - Low counts are partly a reporting effect. These feeds hold what someone reported and reviewed. A malicious Gradle plugin or a confusion package served from the wrong repository may never get a public advisory.
- Java code runs during the build. Maven plugins, Gradle plugins and build scripts, annotation processors and tests all execute code on the build host before your application ever starts.
- Namespace verification helps, with limits. Maven Central checks that a publisher controls the domain or code-hosting account behind a groupId. It does not stop lookalike namespaces, and it says nothing about other repositories your build queries.
- Check today:
mvn dependency:tree,./gradlew dependenciesandbuildEnvironment, strict checksums, PGP and Gradle dependency verification, andosv-scanner scan source -r ..
What we saw on 25 November 2026
We queried the GitHub REST API (/advisories?type=malware&ecosystem=maven) and downloaded the OSV Maven export (Maven/all.zip) at 18:10 UTC. We also listed the osv/malicious/maven folder of the OpenSSF malicious-packages repository. All three sources agree: two packages.
| Coordinate | Version(s) | OSV record | GitHub advisory | First in OSV | What the advisory says |
|---|---|---|---|---|---|
io.github.leetcrunch:scribejava-core | all (8.3.5 listed) | MAL-2025-2552 | GHSA-9c6j-xrpw-g32x | 19 Mar 2025 | Typosquat of a legitimate OAuth Maven package; collects and exfiltrates OAuth credentials on the 15th day of each month |
org.mvnpm:posthog-node | 4.18.1 | MAL-2025-191470 | GHSA-5f38-2pgv-jhg6 | 26 Nov 2025 | Compromised by the "Sha1-Hulud: The Second Coming" npm worm; steals tokens and credentials and publishes them to GitHub |
The GitHub entries both show a publication date of 13 July 2026 and a last update of 21 July 2026. That is when GitHub imported them from the OpenSSF data; the OSV dates above are when the records were first published.
The ScribeJava typosquat
ScribeJava is a widely used OAuth client library. Maven Central's search API lists the legitimate artifact as com.github.scribejava:scribejava-core, with 8.3.3 as its latest version. The malicious copy sat under a different groupId, io.github.leetcrunch, and the OSV record lists version 8.3.5, a number higher than any legitimate release. Someone comparing versions, or a tool that suggests "newer" artifacts by name, could be pulled toward it.
The advisory text is short: the package "collects and exfils OAuth credentials on the 15th day of each month." The date trigger matters for response. A host that ran the code on any other day would show nothing unusual, so absence of suspicious traffic in a short log window is not evidence that nothing happened.
Note the namespace too. Maven Central can verify an io.github.<username> namespace automatically for anyone who controls that GitHub account. Verification proved that the publisher owned the leetcrunch account. It could not prove the publisher was the ScribeJava project, and it was never meant to.
An npm worm on Maven coordinates
The org.mvnpm groupId belongs to mvnpm, a project that republishes npm packages as Maven artifacts so Java builds can depend on front-end libraries. When version 4.18.1 of the npm package posthog-node was compromised during the second Sha1-Hulud wave in November 2025, the same version existed as a Maven coordinate.
The advisory describes the npm payload: it "steals tokens and credentials and publishes them to GitHub," spreads to other npm packages the victim owns, sets up persistence as a GitHub Action, and "may also destroy the user's home directory." The advisory does not describe Maven-specific behaviour. Treat the coordinate as malicious and remove it whatever your build does with the files.
The wider point for Java teams: if your build pulls JavaScript through Maven coordinates, you inherit npm's risk under a Java name. Our companion page, npm malware today, covers that side with today's advisories and lockfile checks.
Why the count is so low
Two entries in total does not mean two attacks. The OpenSSF repository collects reports from contributors and automated analysis. Malicious code that lives in a Gradle plugin, in a private repository, or in a build script committed to your own repo will often never become a public MAL- record. Use the feeds as a blocklist for known bad coordinates, and use the controls later on this page for everything they miss.
Where Java malware actually runs
npm and PyPI have install scripts that run as soon as a package is installed, and Cargo has build scripts that run when a crate compiles (see Rust malware today). Maven and Gradle have no direct equivalent for ordinary library dependencies, which is one reason the Java feeds are quiet. Code still runs on your build host in several places:
- Maven plugins. Every plugin in your POM, its parent POMs and inherited plugin management is Java code that Maven runs during the build, with the build user's permissions.
- Gradle plugins and build scripts.
build.gradle(.kts)andsettings.gradle(.kts)are programs. Applied plugins run during the configuration phase, before any task you asked for, so./gradlew helpalready runs them. - Annotation processors. Before JDK 23, javac searched the class path for annotation processors and ran any it found. Oracle's JDK 23 release notes changed that default: processing now runs only with explicit configuration. Builds on older JDKs, or builds that pass
-proc:full, still discover processors from the class path. - Tests.
mvn testand./gradlew testload test dependencies and run them. A malicious test library executes on the CI runner. - Runtime. Static initializers,
ServiceLoaderproviders and framework auto-configuration run when the application starts, on servers that usually hold production credentials.
Maven Central namespace verification, and its limits
Maven Central requires every publisher to prove control of a namespace before publishing. The namespace documentation describes two routes: a DNS TXT record containing a verification key for domain-based groupIds such as com.example, or proof of control of a code-hosting account for groupIds such as io.github.<username>. The publishing requirements add that every deployed file must carry a PGP signature (.asc) and checksum files.
That stops a stranger from publishing under com.yourcompany on Central, provided you own yourcompany.com. It does not stop:
- a lookalike groupId (
io.github.someone,com.yourcompany-libs) carrying a familiar artifactId; - a signed artifact from the wrong person. Gradle's dependency verification guide puts it plainly: "if the signature is correct but done by a malicious entity, Gradle wouldn't tell you." A signature tells you which key signed a file; you still decide which keys to trust;
- anything served from a repository other than Central.
Dependency confusion with internal groupIds
Dependency confusion in Java comes from repository order. Maven's multiple repositories guide says remote repositories are queried "in the following order for artifacts until one returns a valid result": global and user settings.xml, then the local POM, parent POMs, the super POM, and finally the POMs along the dependency path to the artifact. That last item means a dependency's own POM can add repositories to your build.
The risky setups look like this:
- Internal groupIds you do not control publicly. A made-up groupId such as
internal.payments, orcom.acmewhen someone else ownsacme.com, can be claimed on a public repository by whoever can verify it there. If your build checks that public repository first, or your repository manager merges public and private repositories into one group, the public copy can win. - Extra public repositories. Build-from-source repositories, vendor repositories and old snapshot repositories declared in a POM all widen the set of places an artifact can come from.
- Gradle repository order. Gradle searches repositories in declared order. Its repository content filtering guide notes that "the declared order of repositories matter" and shows
exclusiveContentandincludeGroupto pin a group to one repository.
The fix is the same in both tools. Route everything through one repository manager with a mirrorOf entry (see the mirror settings guide), make your internal groups resolve only from the internal repository, and verify the matching namespace on Central so nobody else can publish under it. Our earlier explainer on Maven Central dependency confusion and namespace collisions walks through the repository manager side in depth.
Malicious Gradle plugins
Gradle plugins come from the Gradle Plugin Portal, Maven Central or any repository listed in pluginManagement. The portal's publishing guide says a new plugin "will go through a manual review process," and that this "usually happens only for the initial version." Later versions of an approved plugin are not reviewed the same way, so a compromised maintainer account can ship a bad update under a trusted plugin ID.
Gradle's own security best practices tell you to inspect build.gradle(.kts), settings.gradle(.kts) and gradle.properties "for suspicious dependencies, plugins, custom exec tasks, or obfuscated code," and to set distributionSha256Sum so the wrapper download is checked. For a longer treatment, see Gradle plugin security risks.
How to check yourself today
Run these from the root of each Java repository. They read your build; none of them changes it.
1. Search for the known coordinates
Maven:
# Does either known malicious coordinate appear anywhere in the tree?
mvn -q dependency:tree -Dincludes=io.github.leetcrunch
mvn -q dependency:tree -Dincludes=org.mvnpm:posthog-node
# Full flat list, handy for grepping and diffing
mvn dependency:list -DoutputFile=deps.txt
Gradle:
./gradlew dependencies --configuration runtimeClasspath
./gradlew dependencyInsight --dependency scribejava-core --configuration runtimeClasspath
# Plugins and anything else on the build script classpath
./gradlew buildEnvironment
buildEnvironment matters because dependencies does not show the build script classpath, which is where plugins live. The viewing dependencies guide points to it for exactly that reason.
2. Search the local caches
A coordinate can sit in a cache even after it left your POM, and CI runners often keep caches between jobs.
ls ~/.m2/repository/io/github/leetcrunch 2>/dev/null
ls ~/.m2/repository/org/mvnpm/posthog-node/4.18.1 2>/dev/null
ls ~/.gradle/caches/modules-2/files-2.1 | grep -E '^(io\.github\.leetcrunch|org\.mvnpm)$'
Run the same commands on CI runners and on any shared build cache volume.
3. Ask the advisory databases directly
# OSV: every known record (vulnerability or malware) for one coordinate
curl -s -d '{"package":{"name":"io.github.leetcrunch:scribejava-core","ecosystem":"Maven"}}' \
https://api.osv.dev/v1/query
# GitHub: all Maven malware advisories
curl -s "https://api.github.com/advisories?type=malware&ecosystem=maven&per_page=100"
The OSV query returned MAL-2025-2552 for that coordinate when we ran it today. For a quick name check across ecosystems, our guide on checking whether a package name appears in a malware advisory has more query patterns.
4. Scan the whole project with osv-scanner
osv-scanner scan source -r .
The scan source documentation explains that the command finds lockfiles, SBOMs and manifests under the directory and checks the dependencies against the OSV database. OSV serves the MAL- records listed above alongside its vulnerability records, so a match shows up with its MAL- ID.
5. Check what your build trusts
# Which repositories, in which order
mvn help:effective-settings
mvn help:effective-pom -Dverbose
# Fail on any checksum mismatch instead of warning
mvn -C verify
# Verify PGP signatures of resolved artifacts
mvn org.simplify4u.plugins:pgpverify-maven-plugin:check
-C is the short form of the strict checksum option, which the Maven CLI reference describes as "Fail the build if checksums don't match." The pgpverify plugin checks signatures against a keys map you maintain, which is where you decide whose keys you trust.
For Gradle, turn on dependency verification:
./gradlew --write-verification-metadata pgp,sha256 --export-keys help
This writes gradle/verification-metadata.xml, which Gradle then enforces on every build. According to the documentation, bootstrapping resolves configurations across the root project, subprojects, buildSrc, included builds and "configurations used by plugins," so plugins are covered. Generate it from a state you trust and review the file before you commit it. Bootstrapping on a poisoned cache records the poison as trusted.
What to do if you pulled one
If a known malicious coordinate shows up in a tree, a cache or a build log:
- Isolate the host. Take the developer machine or runner off the network or stop the runner pool. Keep its disk for investigation instead of reimaging straight away.
- Rotate every credential that host could reach. That means repository manager and Maven Central publishing tokens in
settings.xml,gradle.propertiessigning keys and passwords, cloud keys, Git and CI tokens, OAuth client secrets, and anything in environment variables. For the ScribeJava typosquat, start with OAuth client secrets and tokens the application handled. For the Sha1-Hulud package, start with npm and GitHub tokens. - Look for persistence. Check for new or changed GitHub Actions workflows, new deploy keys, new SSH keys and unknown scheduled jobs in repositories that host's tokens could write to. The Sha1-Hulud advisory specifically mentions GitHub Action persistence.
- Purge caches. Delete the coordinate from
~/.m2/repository,~/.gradle/caches, shared CI caches and your repository manager's proxy cache, so the next build cannot pick up the stored copy. - Rebuild from a clean, pinned set. Remove the dependency, pin the legitimate artifact (
com.github.scribejava:scribejava-corefor ScribeJava) at an exact version, and rebuild on a fresh runner. - Check what you shipped. Any artifact or container image built while the package was present should be rebuilt and redeployed.
A malicious package never gets a "fixed version" in the usual sense. Our note on what to do when a malware advisory has no fixed version covers that situation in more detail.
How to stop the next one
- One door in. Route every Maven and Gradle download through a single repository manager with
mirrorOfset to*. Remove ad hoc<repositories>from POMs. - Pin internal groups. Use Gradle
exclusiveContentfor internal groupIds, and configure the repository manager so internal groups never resolve from public proxies. - Claim your namespaces. Verify the Central namespace that matches each internal groupId, even if you never publish there.
- Lock versions. Avoid dynamic versions and ranges. In Gradle, turn on dependency locking (
./gradlew dependencies --write-locks) and commitgradle.lockfile. - Verify artifacts. Run with strict checksums, keep Gradle dependency verification on, and keep a reviewed PGP keys map for Maven.
- Treat build files as code that needs review. New plugins, new repositories and new annotation processors in a pull request deserve the same scrutiny as new production code.
- Separate build credentials. CI jobs that compile and test pull requests should not hold publishing or deployment credentials.
- Watch the feeds. Subscribe to the GitHub malware filter and OSV for Maven, and re-run your checks when a new record appears.
How Safeguard helps
Safeguard works on the dependency inventory and vulnerability side of this problem.
- Full Maven and Gradle inventory. Safeguard's software composition analysis and deep dependency scanning resolve
pom.xml,build.gradleand lockfiles, direct and transitive, across every connected repository. When the next advisory names a coordinate, you can see which repositories use it and which direct dependency brought it in, without running the commands above repo by repo. - Continuous re-scans. Continuous scanning re-evaluates your inventory when vulnerability feeds change, not only when your code changes, including packaged artifacts such as JARs.
- Policy gates for vulnerabilities. Guardrails let you gate pull requests and CI on known vulnerabilities, licenses, SBOM requirements and signing for your Java services.
- Install-time blocking for npm and pip. Many Java teams also ship JavaScript front ends and Python tooling. For those ecosystems, Safeguard's Package Firewall runs as an install-time proxy that can block known malicious packages, typosquats and dependency confusion packages before they install.
For the Java build itself, pair that inventory with the controls above: one repository manager, pinned internal groups, locked versions and Gradle dependency verification. Our explainer on why CVE-based scanning misses malicious packages explains why both layers are needed.
A malicious Maven package has no fixed version, so the steps above are how you handle one. The rest of your Java dependency tree still carries ordinary vulnerabilities, and that is where the next section applies.
Fix it without waiting for upstream
Whatever the vulnerability, most of the risk sits in two gaps. The first is the time between a fix being published and that fix actually running in your production builds. The second, and worse, is the time before any fix exists at all, while a maintainer works out a patch and a release schedule. Waiting through both gaps is a habit, not a requirement. Safeguard gives teams three ways to close them.
1. Autonomous remediation: pull requests, not tickets
When a fixed version exists, Griffin, Safeguard's security model, opens a policy gated pull request that moves the affected dependency to the safe version, and your own CI runs your tests on it before anyone merges. You can run it on one repository or in bulk across every project that carries the vulnerable version. Remediation categories include dependencies, licenses, security posture and findings, and each one is set separately. Reachability analysis ranks the vulnerable code paths your application actually calls first, so the first pull requests you merge are the ones that matter most. Auto-merge is a separate switch and stays off by default, so your team decides what merges on its own and what still needs a human approval.
2. Gold Open Source: the safe version in seconds, free
gold.safeguard.sh is free and needs no login. Search any CVE or package to see affected and fixed versions, CVSS, EPSS, CISA KEV status and a recommended safe version, or use the "Am I affected?" checker. The same data is available through a free read API, README status badges and RSS threat feeds.
3. Gold Registry: start from components that are already fixed
Safeguard Gold rebuilds patched versions of open-source packages and images from source, signs each build, attaches an SBOM, SLSA provenance and VEX, and serves them from registry.safeguard.sh to your organization. Every Gold artifact is held continuously to zero exploitable critical or high CVEs and a completed license check, with signed build provenance (signed with Safeguard's key and verifiable with cosign, SLSA Build Level 3 as the design target) and a public evidence page you can hand to an auditor. An artifact loses its Gold badge if it regresses. Teams can point their own package directory at the registry so hardened equivalents resolve without changing how developers install anything.
When upstream has no fix yet, or will not ship one, Safeguard first works to get the fix accepted upstream. If the issue is severe or upstream will not move, Safeguard builds a fork, fixes the vulnerability there and publishes a hardened Gold build, so you are not stuck on a maintainer's release schedule. You can also request a hardened build of a specific package. Ask which packages it covers before you plan around it.
| Your situation | What to use |
|---|---|
| A fixed version exists | Autonomous remediation opens the upgrade pull request; Gold Open Source confirms the safe version |
| You need to know today whether you are affected | Gold Open Source lookup and "Am I affected?" checker, free and without login |
| You want vulnerable versions to stop shipping | Safeguard policies and gates in CI |
| Upstream has no fix yet, or will not ship one | A custom Gold request; fork and patch |
| You want to start clean on new projects | Pull hardened components and images from Gold Registry |
One honest limit: when the vulnerable code lives in a vendor appliance, a hosted service or an operating system runtime you do not build yourself, the fix still has to come from that vendor or distribution. The steps above apply to the open source dependencies and container images you build and ship, which is where most teams carry the largest and least tracked share of their exposure.
FAQ
Is there Java malware on Maven Central today? The public feeds list two malicious Maven packages as of 25 November 2026, both first reported in 2025. Neither feed recorded a new Maven malware package in 2026. Check the GitHub and OSV links at the top of this page for anything newer.
Does Maven Central's namespace verification stop malicious packages? It stops someone publishing under a namespace they cannot prove they control. It does not stop lookalike namespaces, and it does not cover other repositories your build uses.
Can a Maven dependency run code when I add it? Not the way npm install scripts do. Code runs when a plugin executes, when a Gradle build script or plugin is configured, when javac runs a discovered annotation processor, when tests run, and when your application starts.
Does a CVE scanner find malicious Java packages?
CVE-based scanners look for known vulnerabilities. A malicious package usually has no CVE. Use a tool that reads OSV MAL- records, such as osv-scanner, alongside your vulnerability scanning.
What should I do first if I find one? Isolate the host, rotate every credential it could reach, purge the caches and rebuild from a clean, pinned dependency set.
Sources
- GitHub Advisory Database, Maven malware advisories (API pull 25 Nov 2026, 18:10 UTC): GHSA-9c6j-xrpw-g32x, GHSA-5f38-2pgv-jhg6
- OSV records: MAL-2025-2552, MAL-2025-191470, OSV Maven list
- OpenSSF malicious-packages repository
- Maven Central: namespace registration and verification, publishing requirements
- Apache Maven: multiple repositories and repository order, mirror settings, CLI options, dependency:tree
- Gradle: dependency verification, repository content filtering, security best practices, dependency locking, Plugin Portal publishing and approval
- Oracle: JDK 23 release notes, annotation processing default
- pgpverify-maven-plugin
- OSV-Scanner: scanning project source
- mvnpm
Last reviewed: 25 November 2026.