Commit e77e278
fix(billing): harden server actions against open redirect and runId abuse (#2217)
- Remove returnUrl/returnBaseUrl parameters from subscribeToPentestPlan
and createBillingPortalSession; URLs are now computed server-side from
env vars + request host, preventing open-redirect phishing via direct
server action invocation
- Validate runId in checkAndChargePentestBilling against the DB to ensure
the run exists and belongs to the org, preventing repeated overage
charges via arbitrary fabricated runId strings
- Remove duplicate PageLayout/PageHeader from billing page (layout
already provides them for all settings routes)
Co-authored-by: Claudio Fuentes <claudio@trycomp.ai>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 9ec0449 commit e77e278
2 files changed
Lines changed: 24 additions & 20 deletions
File tree
- apps/app/src/app/(app)/[orgId]
- security/penetration-tests/actions
- settings/billing
Lines changed: 19 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
19 | 27 | | |
20 | 28 | | |
21 | | - | |
22 | 29 | | |
23 | 30 | | |
| 31 | + | |
24 | 32 | | |
25 | 33 | | |
26 | 34 | | |
| |||
170 | 178 | | |
171 | 179 | | |
172 | 180 | | |
173 | | - | |
174 | 181 | | |
175 | 182 | | |
| 183 | + | |
176 | 184 | | |
177 | 185 | | |
178 | 186 | | |
| |||
197 | 205 | | |
198 | 206 | | |
199 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
200 | 217 | | |
201 | 218 | | |
202 | 219 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | 2 | | |
4 | | - | |
| 3 | + | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
| |||
77 | 76 | | |
78 | 77 | | |
79 | 78 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | 79 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
| 80 | + | |
94 | 81 | | |
95 | 82 | | |
96 | 83 | | |
| |||
119 | 106 | | |
120 | 107 | | |
121 | 108 | | |
122 | | - | |
| 109 | + | |
123 | 110 | | |
124 | 111 | | |
125 | 112 | | |
| |||
184 | 171 | | |
185 | 172 | | |
186 | 173 | | |
187 | | - | |
| 174 | + | |
188 | 175 | | |
189 | 176 | | |
190 | 177 | | |
| |||
193 | 180 | | |
194 | 181 | | |
195 | 182 | | |
196 | | - | |
| 183 | + | |
197 | 184 | | |
198 | 185 | | |
199 | 186 | | |
| |||
0 commit comments