Commit c86cb8a
authored
fix(auth): bind OAuth callback listener to loopback only (#6238)
The interactive login callback server bound ":port" (all interfaces)
while advertising a localhost redirect URL. For the lifetime of a
login, any host on the LAN could probe the listener and abort the
flow by hitting /callback?error=... (no state needed on the error
path). Login-code theft is not possible: the 128-bit state is
validated before token exchange, so the impact is login DoS only.
Bind 127.0.0.1 explicitly, matching the redirect URL host and the
loopback address the port-availability probe already uses. Added
TestListenAddrLoopback asserting the listener address is loopback.
Signed-off-by: Sasha Mitchell <sash.t.mitchell@gmail.com>1 parent 6f04df4 commit c86cb8a
2 files changed
Lines changed: 30 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
190 | 198 | | |
191 | 199 | | |
192 | 200 | | |
| |||
199 | 207 | | |
200 | 208 | | |
201 | 209 | | |
202 | | - | |
| 210 | + | |
203 | 211 | | |
204 | 212 | | |
205 | 213 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
739 | 740 | | |
740 | 741 | | |
741 | 742 | | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
742 | 763 | | |
743 | 764 | | |
744 | 765 | | |
| |||
0 commit comments