-
Notifications
You must be signed in to change notification settings - Fork 122
[EMAIL] Fix CVE-2025-7962: SMTP injection via Jakarta Mail #394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[EMAIL] Fix CVE-2025-7962: SMTP injection via Jakarta Mail #394
Conversation
|
It'd be amazing if anyone had information to help me figure out how to backport this to the 1.6.x series - and maybe get it released as a patch? |
|
Hello @henricook For 1.x, keep in mind that we can't break binary compatibility. |
Thanks Gary, would I raise a PR to the 1.x branch to propose a patch to it if binary compatibility was ok? |
|
I'm reasonably confident that 1.6.7 -> 1.6.8 doesn't include any binary compatibility breaking changes. The internals of SMTPTransport.java were changed, and the only other non test changes were:
|
I'd like to see a PR before I make any promises 😉 |
|
Hello @henricook |
commons-email2-jakarta/pom.xml
Outdated
| <dependency> | ||
| <groupId>org.eclipse.angus</groupId> | ||
| <artifactId>jakarta.mail</artifactId> | ||
| <version>2.0.4</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use the current version 2.0.5? See https://central.sonatype.com/artifact/org.eclipse.angus/jakarta.mail/versions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I must be blind 😢 - on the way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed now @garydgregory
|
The tests that fail in Java 25 and 26 have code like the following: // test bad file
attachment.setPath("");Maybe an empty Path is now allowed? |
Migrate commons-email2-jakarta from com.sun.mail:jakarta.mail:2.0.2 to org.eclipse.angus:jakarta.mail:2.0.5 - the patched successor of the EOL com.sun.mail implementation. Bump commons-email2-javax from com.sun.mail:jakarta.mail:1.6.7 to 1.6.8. Both prior versions are vulnerable to CVE-2025-7962, an SMTP injection flaw allowing attackers to inject arbitrary SMTP commands via \r\n characters in UTF-8 encoded input.
4d2fe24 to
5922190
Compare
I think that gives: |
Summary
commons-email2-jakartafromcom.sun.mail:jakarta.mail:2.0.2toorg.eclipse.angus:jakarta.mail:2.0.4- the patched successor of the EOLcom.sun.mailimplementationcommons-email2-javaxfromcom.sun.mail:jakarta.mail:1.6.7to1.6.8Both versions prior to this change are vulnerable to CVE-2025-7962, an SMTP injection flaw allowing attackers to inject arbitrary SMTP commands via
\r\ncharacters in UTF-8 encoded input.Context
The
com.sun.mail:jakarta.mailimplementation has been superseded by Eclipse Angus, which is described as the "direct successor of JavaMail/JakartaMail". The CVE fix was only released under the Angus coordinates (org.eclipse.angus:jakarta.mail:2.0.4), while the oldcom.sun.mail2.x line remains unpatched.For the
commons-email2-javaxmodule, a backported fix is available atcom.sun.mail:jakarta.mail:1.6.8.References