Commit 0e2be11
committed
Security fixes in SMTP_SSL and SMTP_TLS strategies
- The SMTP_SSL and SMTP_TLS transport strategies now validate certificates
by setting JavaMail's `mail.<protocol>.ssl.checkserveridentity` property
to true.
Previously, no identity validation was performed, leaving SMTPS and
STARTTLS connections vulnerable to man-in-the-middle attacks. Without
identity validation, JavaMail accepts _any_ certificate issued by a
JVM-trusted CA, regardless of the identity encoded in the certificate.
- The SMTP_TLS transport strategy now requires STARTTLS support by setting
JavaMail's `mail.smtp.starttls.required` property to true.
Previously, STARTTLS support was not required, enabling a man-in-the-middle
attack whereby an attacker could strip the STARTTLS request from an SMTP
connection, causing JavaMail to fall back to plaintext SMTP for
authentication and email transport.1 parent 43d42dc commit 0e2be11
File tree
2 files changed
+19
-4
lines changed- src
- main/java/org/simplejavamail/mailer/config
- test/java/org/simplejavamail/mailer
2 files changed
+19
-4
lines changedLines changed: 11 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
82 | | - | |
| 83 | + | |
| 84 | + | |
83 | 85 | | |
84 | 86 | | |
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
89 | 91 | | |
| 92 | + | |
90 | 93 | | |
91 | 94 | | |
92 | 95 | | |
| |||
127 | 130 | | |
128 | 131 | | |
129 | 132 | | |
130 | | - | |
| 133 | + | |
| 134 | + | |
131 | 135 | | |
132 | 136 | | |
133 | 137 | | |
134 | | - | |
| 138 | + | |
| 139 | + | |
135 | 140 | | |
136 | 141 | | |
137 | 142 | | |
| |||
140 | 145 | | |
141 | 146 | | |
142 | 147 | | |
| 148 | + | |
| 149 | + | |
143 | 150 | | |
144 | 151 | | |
145 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
| |||
112 | 114 | | |
113 | 115 | | |
114 | 116 | | |
| 117 | + | |
| 118 | + | |
115 | 119 | | |
116 | 120 | | |
117 | 121 | | |
| |||
131 | 135 | | |
132 | 136 | | |
133 | 137 | | |
| 138 | + | |
| 139 | + | |
134 | 140 | | |
135 | 141 | | |
136 | 142 | | |
| |||
150 | 156 | | |
151 | 157 | | |
152 | 158 | | |
| 159 | + | |
| 160 | + | |
153 | 161 | | |
154 | 162 | | |
155 | 163 | | |
| |||
0 commit comments