r/java • u/ulldma • 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.html14
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
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.
5
u/yawkat Jan 07 '20
https://max.computer/blog/how-to-take-over-the-computer-of-any-java-or-clojure-or-scala-developer/
Better not be building maven projects on public wifi without https.
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
Jan 07 '20
[deleted]
1
0
Jan 07 '20
[deleted]
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
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.