Open bagipro opened 10 months ago
Hello, thank you for your report.
The way I understand it we can't really do anything about this. We could only stop using affected dependencies which doesn't make much sense as this library is about wrapping and improving those external dependencies. We are "just a messenger" in this. Even if we stopped including them I don't think our users would actually stopped using them as both doobie
and FS2 are well-known and often used libraries.
Hey @jakubjanecek,
I think adding signature verification would solve the problem.
Thanks!
Hey,
I wasn't able to report this security vulnerability via the only given channel on BugCrowd. The BugCrowd triage team said that Avast OOS isn't in scope and such vulnerabilities cannot be reported via that platform. So the only place where I can report is here.
Describe the bug
This project,
avast/sst-seed.g8
andavast/gcp4cats
are vulnerable to MavenGate supply chain attack. There are the following vulnerable dependencies:Group ID:
org.tpolecat
, domain available for registration:tpolecat.org
Group ID:
co.fs2
, domain available for registration:fs2.co
The attack looks as follows:
groupId
values on public repositories because they all require DNS TXT verification (this is verified for MavenCentral, JitPack, and Gradle). This verification is possible when an attacker can purchase the domain.groupId
value is registered in their system, they require manual verification, as they say: "Any future attempts to leverage current and future expired domains will undergo a thorough assessment by our team, ensuring evidence of ownership of not just the domain but also the underlying project".groupId
.To Reproduce
I'm providing an attack example for this project (
com.avast:sst-doobie-hikari_3:0.18.4
) that includes vulnerableorg.tpolecat:doobie-core_3:0.13.4
. However, before the article was released,tpolecat.org
andfs2.co
were available for registration, but looks like they were purchased on Jan 19th and Jan 18th accordingly:It could be a sign of an ongoing attack or a vulnerable company to MavenGate decided to secure themselves that way.
Check the attached Avast_PoC.zip, there is the project structure:
com.avast:sst-doobie-hikari_3:0.18.4
dependency.com.avast:sst-doobie-hikari_3:0.18.4
includes vulnerableorg.tpolecat:doobie-core_3:0.13.4
which is placed toEVIL_REPO/
. I've modified itsjar
and simply added theevil.Evil
class.When you run
mvn clean package
, it will fetch the infected artifact. After the build finishes, you will see thetarget/poc-1.0-jar-with-dependencies.jar
that will include the dependencies (a typical runnablejar
includes dependencies). After you decompile or unzip it, you will see the poisoning effect:Additional context
So the conclusion things:
evil.Evil
class is an example, an attacker can modify sources of this library in any way too.~/.m2/settings.xml
in the case of Maven), it will lead to artifact poisoning when attacking dependencies.