Commit 1d67163
Reject non-ASCII OIDC hosts and fix review nits
A review flagged several minor issues; this commit addresses the
actionable ones.
Endpoint.parse now rejects a non-ASCII host. String.equalsIgnoreCase
folds several non-ASCII letters onto ASCII (U+0130 -> i, U+212A -> k,
...), so a homoglyph host advertised by a tampered /settings could
otherwise pass the origin pin against a pinned issuer; a non-ASCII host
would not resolve anyway (the HTTP layer sends it to the OS resolver as
raw UTF-8, no IDNA). Endpoint.parse also lower-cases the URL scheme
before matching so a case-insensitive HTTPS/Http (RFC 3986) builds,
matching the browser launcher; toLowerCase folds only ASCII, so a
homoglyph scheme stays rejected. Renamed sameOrigin to isSameOrigin per
the is/has convention.
FileTokenStore.save now retries the atomic rename on a transient Windows
AccessDeniedException (a sharing violation from a concurrent reader), so
a routine read/write overlap does not needlessly degrade best-effort
persistence. POSIX rename over an open file is unaffected.
Smaller nits: DirectUtf8Sink.put(byte[],int,int) asserts its range;
AbstractLineHttpSender.close() nulls jsonErrorParser after freeing it;
Utf16Sink.putAsPrintable skips a redundant charAt on the BMP fast path;
and a duplicated comment in TokenStoreKey is removed.
Adds OidcDeviceAuthTest cases: a non-ASCII host and an uppercase scheme
(both proven to fail against the pre-fix code), and the issuer-pin
accept path for host casing and an implicit vs explicit 443 port.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 9e0a756 commit 1d67163
7 files changed
Lines changed: 107 additions & 23 deletions
File tree
- core/src
- main/java/io/questdb/client
- cutlass
- auth
- line/http
- std/str
- test/java/io/questdb/client/test/cutlass/auth
Lines changed: 33 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
133 | 140 | | |
134 | 141 | | |
135 | 142 | | |
| |||
286 | 293 | | |
287 | 294 | | |
288 | 295 | | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
| 296 | + | |
295 | 297 | | |
296 | 298 | | |
297 | 299 | | |
| |||
536 | 538 | | |
537 | 539 | | |
538 | 540 | | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
539 | 566 | | |
540 | 567 | | |
541 | 568 | | |
| |||
Lines changed: 28 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
363 | | - | |
| 363 | + | |
364 | 364 | | |
365 | 365 | | |
366 | | - | |
| 366 | + | |
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| |||
810 | 810 | | |
811 | 811 | | |
812 | 812 | | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
813 | 821 | | |
814 | 822 | | |
815 | 823 | | |
| |||
917 | 925 | | |
918 | 926 | | |
919 | 927 | | |
920 | | - | |
921 | | - | |
922 | | - | |
923 | | - | |
924 | | - | |
925 | | - | |
926 | 928 | | |
927 | 929 | | |
928 | 930 | | |
| |||
984 | 986 | | |
985 | 987 | | |
986 | 988 | | |
987 | | - | |
| 989 | + | |
988 | 990 | | |
989 | 991 | | |
990 | 992 | | |
991 | 993 | | |
992 | 994 | | |
993 | 995 | | |
994 | | - | |
| 996 | + | |
995 | 997 | | |
996 | 998 | | |
997 | 999 | | |
998 | 1000 | | |
999 | 1001 | | |
1000 | | - | |
| 1002 | + | |
1001 | 1003 | | |
1002 | 1004 | | |
1003 | 1005 | | |
| |||
1946 | 1948 | | |
1947 | 1949 | | |
1948 | 1950 | | |
1949 | | - | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
1950 | 1955 | | |
1951 | 1956 | | |
1952 | 1957 | | |
| |||
2006 | 2011 | | |
2007 | 2012 | | |
2008 | 2013 | | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
2009 | 2025 | | |
2010 | 2026 | | |
2011 | 2027 | | |
| |||
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
75 | 73 | | |
76 | 74 | | |
77 | 75 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
478 | | - | |
| 478 | + | |
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| |||
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
| |||
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
216 | 233 | | |
217 | 234 | | |
218 | 235 | | |
| |||
1024 | 1041 | | |
1025 | 1042 | | |
1026 | 1043 | | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
1027 | 1061 | | |
1028 | 1062 | | |
1029 | 1063 | | |
| |||
1058 | 1092 | | |
1059 | 1093 | | |
1060 | 1094 | | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
1061 | 1100 | | |
1062 | 1101 | | |
1063 | 1102 | | |
| |||
0 commit comments