Commit ec062ab
Fix XSS/loop/webhook findings from Manage Subscriptions review
- Remove member-controlled data (CustomerEmail, subscription Id) from
onsubmit confirm() JS strings in ManageSubscriptions/Index.cshtml.
Razor HTML-encoding is decoded by the HTML parser before the JS
engine sees it, so a literal apostrophe (e.g. o'brien@example.com)
reached the JS string context, silently skipping confirmation
(including for irreversible Cancel Now) or enabling stored XSS in
the admin session. Confirm messages are now static.
- Fix CustomerSubscriptionUpdatedWebHook comparing stripeEvent.Type
against EventTypes.CustomerUpdated ("customer.updated") instead of
EventTypes.CustomerSubscriptionUpdated ("customer.subscription.updated"),
which made the endpoint reject every real event it receives with an
uncaught 500.
- Harden StripeSubscriptionHandlerService.ListBillableAsync's pagination
loop against an infinite loop if Stripe ever returns HasMore=true with
an empty Data page.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent e5df5c2 commit ec062ab
3 files changed
Lines changed: 5 additions & 5 deletions
File tree
- src
- DevBetterWeb.Infrastructure/SubscriptionHandler/StripeSubscriptionHandler
- DevBetterWeb.Web
- Endpoints/StripeWebhookEndpoints
- Pages/Admin/ManageSubscriptions
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
0 commit comments