Poll votes accept any sessionId from the client, so one session can vote in another
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 86/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- security
調査の方向性
apps/ws-server/src/utils/handleMessages.ts の poll:vote ケースと、apps/ws-server/src/utils/handleMessages.poll.test.ts のテストを読みます。ハンドラーがセッション ID と参加者 ID をどのように取得するかを確認し、ポーリングハンドラーのテストを実行します。投票でソケットのセッション ID と参加者 ID が使われ、テストで外部の ID が網羅されていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
What happens
poll:vote is the only poll handler that does not check the socket's own session. Every other one calls authorizeOrganizerAction, which binds the action to client.sessionId. The vote handler reads sessionId straight out of the message payload:
// apps/ws-server/src/utils/handleMessages.ts
case 'poll:vote': {
const { sessionId, pollId, optionId, participantId } = payload;
const voterId = client.participantId || participantId;
if (!voterId || !sessionId || !pollId || !optionId) break;
const result = votePoll(sessionId, pollId, optionId, voterId);
Compare with the helper every other poll handler uses:
// apps/ws-server/src/utils/organizerAuth.ts
if (payload?.sessionId && payload.sessionId !== client.sessionId) {
sendError(client, "SESSION_MISMATCH", "This message is for a different session.");
return null;
}
Why it matters
A participant joined to session A can send poll:vote with session B's id. If they can guess or observe a poll id in another session, their vote lands there. votePoll looks the poll up purely by the payload's sessionId and never asks whether the socket belongs to it.
The vote also broadcasts to the other session, so participants in B see a vote count move for someone who was never in the room.
Reproducing
- Join session A as a participant
- Have a host start a poll in session B, note its
pollIdandsessionId(both are in thepoll:startedbroadcast to B's participants) - From A's socket send
{ type: 'poll:vote', payload: { sessionId: B, pollId: B's poll, optionId: ..., participantId: <A's id> } } - The vote is counted in B
The fix
Use the socket's own session, the same as every other handler:
case 'poll:vote': {
if (!client.sessionId || !client.participantId) break;
const { pollId, optionId } = payload;
if (!pollId || !optionId) break;
const result = votePoll(client.sessionId, pollId, optionId, client.participantId);
Note the second half: client.participantId || participantId also lets a client supply someone else's participant id when the socket has none, which both ballot-stuffs and overwrites another player's vote. The id should come only from the socket, which is set at join time.
A test in apps/ws-server/src/utils/handleMessages.poll.test.ts should cover both: a vote with a foreign sessionId is refused, and a vote with a foreign participantId is attributed to the socket's own participant.
Files
apps/ws-server/src/utils/handleMessages.ts— thepoll:votecaseapps/ws-server/src/utils/handleMessages.poll.test.ts— tests
- 主要言語
- TypeScript
- スター
- 21
- フォーク
- 7
- 平均マージ
- 11時間 14分
- マージ済み PR(30日)
- 30
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TheCodeHeist-Coder/Rexial のほかの issue
-
Lint does not block a merge, and the same test step runs twice対応中かも @spikedeeev が 7 日前に担当しました。 オープンBackend first issue bug good first issue help wanted level1 nsoc26
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
TheCodeHeist-Coder/Rexial#243 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Add CodeQL and dependency scanning so a malicious or vulnerable dependency is caught対応中かも @divyanshAgarwal123 が 9 日前に担当しました。 オープンBackend first issue enhancement help wanted level3 nsoc26
難易度 2/5 半日 初心者へのやさしさ 62/100
TheCodeHeist-Coder/Rexial#242 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
fix: validate types for login email and password (500 on non-string or missing body)再び着手できるかも @spikedeeev が 16 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
TheCodeHeist-Coder/Rexial#235 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: Poll voter loses their "You voted" state as soon as someone else votes対応中かも @daocuong11 が 6 日前に担当しました。 オープンlevel2 nsoc26
難易度 3/5 1〜2日 初心者へのやさしさ 74/100
TheCodeHeist-Coder/Rexial#282 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
security: remediate the dependency baseline before enforcing the audit gate対応中かも @divyanshAgarwal123 が 6 日前に担当しました。 オープンlevel2 nsoc26
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
TheCodeHeist-Coder/Rexial#266 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
TheCodeHeist-Coder/Rexial の issue をすべて見る
似ている issue
-
clawsweeper:intake:bug clawsweeper:intake:needs-environment
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
openclaw/openclaw#212827 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
KT-2245 e2e specs that call the backend directly fall back to the developer's own Kronn on :3140オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Use one constant for the 10,000-character input limit対応中かも @NginxL が今日担当しました。 オープンgood first issue refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
aniru-dh21/snap-validate#51 ·
メンテナーはふだん 1 日以内に返信
-
dependencies effort: small good first issue priority: low
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
TMHSDigital/screencast-mcp#509 ·
メンテナーはふだん 1 日以内に返信
-
from-review tech-debt testing
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
blamechris/chroxy#9520 ·
メンテナーはふだん 1 日以内に返信