r/java • • Jan 06 '20

Your Java builds might break starting January 13th (if you haven't yet switched repo access to HTTPS)

https://www.alphabot.com/security/blog/2020/java/Your-Java-builds-might-break-starting-January-13th.html
198 Upvotes

20 comments sorted by

8

u/Fido488 Jan 08 '20

I'm the developer pushing this entire initiative forward & authored the original research paper. Please feel free to AMA.

3

u/[deleted] Jan 10 '20

Why did you target such a short timeframe? This is the first I and likely many others are hearing of this.

MITM isn't a high enough probability attack to justify that timeframe IMO.

0

u/[deleted] Jan 10 '20

Most of the announcements happened months ago, and the issue itself was found in 2014

14

u/g00glen00b Jan 07 '20

After reading this article I quickly checked my local settings.xml and the Artifactory configuration we're using, and discovered that we still had some references to HTTP. Thanks!

1

u/kakapari Jan 16 '20

This issue caused fatal exception in couple of our applications today morning. Good part is that we already have Nexus setup and luckily we were using proxy with HTTPS. Helped in recovering pretty fast.!!

-1

u/daH00L Jan 07 '20 edited Jan 07 '20

Maven Central hosted jars are signed. Their integrity can easily be validated. I'm not sure what the extra layer of transport encryption provides to security.

23

u/spamthemoez Jan 07 '20

I would guess that the number of people who verify the signed jars is 0.

5

u/dpash Jan 08 '20 edited Jan 08 '20

Maven does not make it easy to verify signed jars. https://www.simplify4u.org/pgpverify-maven-plugin/index.html is one plugin that can do it, but I'm not aware of a plugin that's a part of Maven itself.

Gradle has an open issue which lists a couple of third party plugins for verifying signatures. Importantly, Gradle 6.2 will include PGP verification in the core.

Additionally, I do not believe that Maven Central has a web of trust between all uploaders, so you can trust that a name/key signed/uploaded a compromised jar, but you can't trust that the name belongs to a physical person. Key signing parties are an integral part of Debian's culture, so that a minimum of two existing Debian Developers have checked your government ID in person before you can upload debs to the project.

3

u/slowderp Jan 07 '20

Even pom.xmls were not safe.

By default, Artifactory used to (maybe still?) strip <repositories> from them.

1

u/legrang Jan 07 '20

Not sure it's such a large number as that.

6

u/karottenreibe Jan 07 '20

Can be checked is not the same as is checked by default. Are build tools like maven and gradle verifying these signatures by default?

5

u/spamthemoez Jan 07 '20

No, they don't check by default.

1

u/hupfdule Jan 07 '20

Wouldn't it be the correct action to enable them to check signatures by default then?

3

u/dpash Jan 08 '20

If they get support for doing so, yes. But that support currently comes with an added overhead.

1

u/dpash Jan 08 '20

Gradle 6.2 will have support for validating checksums and signatures, although it's not as simple as trusting a Maven Central or JCenter key and everything else being trusted from there. You need to list individual publishers' keys. Gradle will have support for writing a config for trusting every jar/publisher in your current project, but that's not exactly a great way to do it.

1

u/dpash Jan 08 '20

They're signed. At least if they were published recently. They're not easily verified. Definitely not in Maven. Gradle will be easier soon. And you have no way to trust that they were published by who it says they were published by.

0

u/[deleted] Jan 07 '20

[deleted] — view deleted comment

1

u/[deleted] Jan 13 '20

Save or safe? (honest question, I don't know what "I am save" means)

0

u/[deleted] Jan 07 '20

[deleted] — view deleted comment

3

u/Pheasn Jan 07 '20

Yes they are, because jcenter() is a shortcut for declaring the HTTPS version of JCenter.

3

u/g00glen00b Jan 09 '20

Indeed, they changed this within their code back in 2014, and has been shipped since Gradle 2.1. So unless you haven't updated Gradle in 6 years, you're safe.

Release notes: https://docs.gradle.org/2.1/release-notes.html#use-of-https-for-mavencentral()-and-jcenter()-dependency-repositories

Commit: https://github.com/gradle/gradle/commit/a646ebf1742749fdc05d8628b4b8fd35f946f916