Invitation, recommendation and Stripe webhook endpoints crash on malformed input
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
調査の方向性
Start with the three named entry points: contentcuration/contentcuration/views/users.py (send_invitation_email), contentcuration/contentcuration/viewsets/recommendation.py (RecommendationView.post), and contentcuration/contentcuration/views/subscription.py (stripe_webhook and its serializers). Follow the validation strategy in issue #6387 and add regression tests for every reproduced input listed here. Done means malformed invitation and recommendation requests return 400, while the two invalid Stripe events return 200 without changing the subscription.
索引モデルが issue の本文から書いたものです。
説明
Overview
send_invitation_email and RecommendationView read request.data by key without a serializer, and the Stripe webhook's serializers accept two payload shapes that then crash. A body of the wrong shape, or a field of the wrong type, length or value, raises an exception and the request returns 500.
Complexity: Medium
Target branch: hotfixes
Context
All sites below fail with the inputs shown, and each input was reproduced:
send_invitation_email: a JSON list body,user_email: 5, a 120-character email, a 60-charactershare_mode, auser_emailcontaining a newline (BadHeaderError), and a nonexistentchannel_id(DoesNotExist, raised before the permission check). It also storesnot an emailas an invitation, and anyshare_modeother thanVIEW_ACCESSgrants edit access on accept.RecommendationView.post: a JSON list body, a JSON string body, or a form-encoded body.request.data.popruns before the schema check.stripe_webhook, after the signature check passes: acustomer.subscription.updatedevent with statusactiveand emptyitems.dataraisesIndexErrorinsave. Acurrent_period_endof10**15raisesValueErrorinTimestampField.to_internal_value, whichis_validdoesn't catch. Stripe retries a webhook that returns 500.
The Change
send_invitation_emailandRecommendationViewshould validate their bodies with DRF serializers, following the strategy in #6387, and return 400 for malformed input.send_invitation_emailshould accept only a valid email address and ashare_modeofEDIT_ACCESSorVIEW_ACCESS.stripe_webhookshould handle these payloads like any other event its serializer rejects: log a warning and return 200 without changing the subscription.
Acceptance Criteria
General
- Every input listed in Context for
send_invitation_emailandRecommendationViewreturns 400 instead of 500. -
send_invitation_emailreturns 400 and creates no invitation for an invalid email address or ashare_modeother thanEDIT_ACCESSorVIEW_ACCESS. - The two Stripe payloads in Context return 200 and leave the user's subscription unchanged.
Testing
- Each input in Context has a regression test.
AI usage
I scoped the audit and chose the validation strategy in #6387. Claude Code found and reproduced these failures and drafted this issue.
- 主要言語
- JavaScript
- スター
- 214
- フォーク
- 327
- 平均マージ
- 17時間 5分
- マージ済み PR(30日)
- 25
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
learningequality/studio のほかの issue
-
Community library status changes don't update `date_updated`対応中かも @ArpitaSamanta10 が 14 日前に担当しました。 オープンcommunity-contribution-in-progress DEV: backend good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
learningequality/studio#6414 · コメント 8 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Activation key can activate a different account whose email differs only in case対応中かも @Madhu-priya123 が 5 日前に担当しました。 オープンDEV: backend
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
learningequality/studio#6410 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
DEV: backend
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
learningequality/studio#6409 ·
メンテナーはふだん 1 日以内に返信
-
DEV: backend
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
learningequality/studio#6407 ·
メンテナーはふだん 1 日以内に返信
-
Stripe webhook accepts events when no webhook secret is configured対応中かも @adibmbrk が 14 日前に担当しました。 オープンcommunity-contribution-in-progress DEV: backend good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
learningequality/studio#6404 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
learningequality/studio の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
babalae/bettergi-scripts-list#3905 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] "Configure Colota" opens Colota with "Invalid configuration: No configuration data in URL"オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 87/100
dedicatedcode/reitti#1445 ·
メンテナーはふだん 1 日以内に返信
-
New tool: Uncle Desk対応中かも @github-actions が今日担当しました。 オープンsubmission triage
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
kausalflow/tools#384 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
-
area: css
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信