Commit 754a258
committed
AXIS2-6055 Restrict preemptive Basic Auth to HTTPS connections
Preemptive authentication sends credentials on the first request
without waiting for a 401 challenge. Over plain HTTP, base64-encoded
credentials are trivially interceptable.
Add HTTPS check: preemptive auth only sends the Authorization header
when the connection scheme is HTTPS. On HTTP, logs a warning and
skips preemptive auth — credentials will still be sent via the
normal challenge/response flow if the server requests them.
Found by local Gemini Pro security review.1 parent 5a4971f commit 754a258
1 file changed
Lines changed: 10 additions & 3 deletions
File tree
- modules/transport/http/src/main/java/org/apache/axis2/transport/http/impl/httpclient5
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
| 342 | + | |
342 | 343 | | |
343 | | - | |
344 | | - | |
345 | | - | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
346 | 353 | | |
347 | 354 | | |
348 | 355 | | |
| |||
0 commit comments