Stripe webhook accepts events when no webhook secret is configured
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 78/100
Rechercherichtung
Lies contentcuration/contentcuration/settings.py und den View stripe_webhook in contentcuration/contentcuration/views/subscription.py. Ergänze Tests für ein leeres konfiguriertes Secret und ein korrekt signiertes Event, wenn ein Secret gesetzt ist; bestätige, dass Anfragen mit leerem Secret 4xx zurückgeben, ohne Abonnementdaten zu ändern, während gültige signierte Events weiterhin funktionieren. Protokolliere einen Fehler, wenn das Secret fehlt, und stelle sicher, dass die App ohne Stripe-Variablen starten kann.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
🙂 Looking for an issue? Welcome! This issue is open for contribution. If this is the first time you’re requesting an issue, please:
- Read Contributing guidelines carefully. Pay extra attention to Using generative AI. Pull requests and comments that don’t follow the guidelines won’t be answered.
- Confirm that you’ve read the guidelines in your comment.
Overview
STRIPE_WEBHOOK_SECRET defaults to an empty string when its environment variable is unset, and stripe_webhook then verifies events against that empty key. On a deployment without the variable, anyone can send a webhook signed with the empty key and change a user's subscription storage.
Complexity: Low
Target branch: hotfixes
Context
settings.pyreadsSTRIPE_LIVE_WEBHOOK_SECRETorSTRIPE_TEST_WEBHOOK_SECRETwith a default of"".stripe_webhookpasses that value tostripe.Webhook.construct_eventunchecked.- Reproduced under the test settings: a
customer.subscription.updatedevent signed with an empty secret was accepted and set the user'ssubscription_disk_space.
The Change
stripe_webhookshould reject every event when the webhook secret is empty, and log an error saying the secret isn't configured.- Studio should still start without the Stripe variables, so development and test environments keep working.
Acceptance Criteria
General
- With an empty webhook secret, every webhook request returns 4xx and changes no subscription.
- With a webhook secret set, correctly signed events are handled as before.
Testing
- Tests cover an event signed with an empty secret while none is configured, and a correctly signed event while one is.
AI usage
I chose which audit findings belong in #6398 and set the access pattern. Claude Code found and reproduced this gap and drafted this issue.
- Vorherrschende Sprache
- Python
- Sterne
- 212
- Forks
- 321
- Ø Merge
- 1 T. 7 Std.
- Gemergte PRs (30 T.)
- 14
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus learningequality/studio
-
Community library status changes don't update `date_updated`Evtl. vergeben @LightCreator1007 hat das vor 1 Tag übernommen. OffenDEV: backend good first issue help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
learningequality/studio#6414 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
DEV: backend
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
learningequality/studio#6410 ·
Maintainer antworten meist innerhalb von 1 Tag
-
DEV: backend
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
learningequality/studio#6409 ·
Maintainer antworten meist innerhalb von 1 Tag
-
DEV: backend
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
learningequality/studio#6407 ·
Maintainer antworten meist innerhalb von 1 Tag
-
DEV: backend good first issue help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
learningequality/studio#6400 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in learningequality/studio
Ähnliche Issues
-
[Bug]: HTTP 499 (Client Closed Request) is classified as a non-retryable format_error, so a mid-flight abort fails the turn over instead of retryingEvtl. vergeben @yipinghuang1991 hat das heute übernommen. Offencomp/agent P2 type/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
NousResearch/hermes-agent#156837 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Bug: Missing continue on ValueError in CpanBackend.check_feed causes UnboundLocalError or duplicate yieldsEvtl. vergeben @muskan-creates352 hat das heute übernommen. Offen
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 86/100
fedora-infra/anitya#2188 ·
Maintainer antworten meist innerhalb von 1 Tag
-
docs documentation need-triage SaaS
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
integration:hermes
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
vectorize-io/hindsight#6601 ·
Maintainer antworten meist innerhalb von 1 Tag
-
triage:product type:bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
dbt-labs/dbt-adapters#2333 ·
Maintainer antworten meist innerhalb von 1 Tag