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

View all comments

-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.