Repository navigation
Commit d6280c7
victhorbi
fix: harden rate-limit IP resolution + guard stale generation in transak checkout catch
- widget-url route: resolveClientIp prefers x-real-ip (written by trusted
proxies, unspoofable from the client) over the leftmost x-forwarded-for
entry; falls back to 'unknown' bucket when no public IP is available so
attackers cannot trivially rotate headers to bypass the rate limit.
- useTransakCheckout open(): guard the catch block with genRef.current !== gen
so a superseded generation does not overwrite the active generation's
error/status (matches the guard already used before instance assignment).1 parent 580e744 commit d6280c7
2 files changed
Lines changed: 26 additions & 2 deletions
File tree
- examples/next-template/src/app/api/transak/widget-url
- packages/vechain-kit/src/hooks/payments
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
51 | 73 | | |
52 | 74 | | |
53 | 75 | | |
| |||
123 | 145 | | |
124 | 146 | | |
125 | 147 | | |
126 | | - | |
127 | | - | |
| 148 | + | |
128 | 149 | | |
129 | 150 | | |
130 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
184 | 187 | | |
185 | 188 | | |
186 | 189 | | |
| |||
0 commit comments