Deprecate usage of javax.mail package
There is javax.mail dependency which was marked as vulnerable. For what this dependency is used? It is useful?
<dependency>
<groupId>com.nimbusds</groupId>
<artifactId>oauth2-oidc-sdk</artifactId>
<version>4.17</version>
</dependency>
Comments (14)
-
-
reporter Probably no. Maybe we can use other lib?
-
Hi, I'm the core maintainer of the OIDC SDK.
I'm not aware of a suitable Java lib replacement for these two classes - for representing emails and content type headers.
One way around that is to deprecate the associated getters / setters in favor of simple string based ones, and mark javax.mail as optional dependency.
While the mail and content-type format checking can probably be replicated some way.
What is your take on this?
-
reporter Hi,
maybe apacha.http.core or org.springframework.http. But I think that optional dependency is appropriate solution.
Thanks, Tomas
-
Categorised as proposal to represent content types and email addresses as plain strings.
-
reporter Ok, agree.
-
- changed title to Deprecate usage of javax.mail package
The javax.mail CVE-2007-6059 vulnerability brought forward by reporter doesn't affect the SDK, but let's deprecate usage of this package.
-
Deprecated use of javax.mail.internet.InternetAddress (commit 25a3273).
ContentType will need more work.
-
Issue
#266was marked as a duplicate of this issue. -
This also breaks the usage of this library on android, since javax.mail is not usable there:
Caused by: java.lang.ClassNotFoundException: Didn't find class "java.awt.datatransfer.Transferable" on path: at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:134) at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379) at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312) at java.lang.String javax.mail.internet.MimeUtility.quote(java.lang.String, java.lang.String) (MimeUtility.java:1013) at java.lang.String javax.mail.internet.ParameterList.quote(java.lang.String) (ParameterList.java:772) at java.lang.String javax.mail.internet.ParameterList.toString(int) (ParameterList.java:719) at java.lang.String javax.mail.internet.ContentType.toString() (ContentType.java:229) at void com.nimbusds.oauth2.sdk.http.HTTPMessage.setContentType(javax.mail.internet.ContentType) (HTTPMessage.java:81) at void com.nimbusds.oauth2.sdk.http.HTTPRequest.setContentType(javax.mail.internet.ContentType) (HTTPRequest.java:69) at com.nimbusds.oauth2.sdk.http.HTTPRequest com.nimbusds.oauth2.sdk.TokenRequest.toHTTPRequest() (TokenRequest.java:429)
-
- edited description
- changed status to resolved
bf171497 -> Makes
com.sun.mail:javax.mail
optional, use kept only in deprecated API calls that depend on it -
Released as part of v7.0 to Maven Central
-
- changed status to open
Due to class loading issues javax.mail was restored as non-optional dep in 7.1.1, see issue
#291. Will be completely removed in v8.0. -
- changed status to resolved
Removed javax.mail for 8.0: 63677d20
- Log in to comment
Hi Thomas,
It's apparently used to represent Content-Type headers and email addresses:
Is that a potential issue?