High: several sensitive admin actions bypass sudo re-authentication
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 62/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- typescript
調査の方向性
packages/hydrooj/src/handler/manage.ts から始め、postRestart、SystemScriptHandler.post、SystemUserImportHandler.post を近くにある保護されたハンドラと比較します。packages/hydrooj/src/service/server.ts の requireSudo を読み、その後 /manage ハンドラを確認して、一貫した step-up 保護になっていることを確認します。完了条件は、一覧にある影響の大きいアクションとその他の機密性の高い管理ルートで、意図した sudo 確認が強制されることです。
索引モデルが issue の本文から書いたものです。
説明
Summary
Several high-impact administrative actions appear to require only PRIV_EDIT_SYSTEM but do not enforce requireSudo re-authentication, while other sensitive admin routes in the same file do require sudo confirmation.
This leads to inconsistent protection for dangerous actions such as restart, script execution, and bulk user import.
Impact
If an admin session is stolen, left open, or used in a shared environment, an attacker may be able to:
- restart the service
- execute system scripts
- bulk import accounts and modify groups
without triggering the extra sudo confirmation that is already used elsewhere for sensitive operations.
Code References
Sensitive actions without requireSudo
packages/hydrooj/src/handler/manage.ts:80-89postRestart()executespm2 reload
packages/hydrooj/src/handler/manage.ts:92-131SystemScriptHandler.post()executesglobal.Hydro.script[id].run(...)
packages/hydrooj/src/handler/manage.ts:235-307SystemUserImportHandler.post()performs bulk user creation and group updates
Sensitive actions with requireSudo in the same file
packages/hydrooj/src/handler/manage.ts:134-170- system settings
packages/hydrooj/src/handler/manage.ts:173-231- config editing
packages/hydrooj/src/handler/manage.ts:314-349- user privilege management
Sudo implementation
packages/hydrooj/src/service/server.ts:47-73requireSudodecorator implementation
Why this is a security issue
The project already recognizes the need for step-up authentication through requireSudo, but the protection is applied inconsistently.
Restarting the service, executing system scripts, and bulk importing users are all high-impact actions and should be protected at least as strictly as settings or privilege pages.
Suggested Fix
- Apply
@requireSudoconsistently to all high-impact administrative actions. - Review all
/manage/*handlers for step-up authentication consistency. - Consider documenting a security policy for which actions must require sudo confirmation.
Additional Notes
This report is based on code review of:
packages/hydrooj/src/handler/manage.tspackages/hydrooj/src/service/server.ts
- 主要言語
- TypeScript
- スター
- 7.3k
- フォーク
- 504
- 平均マージ
- 11時間 29分
- マージ済み PR(30日)
- 2
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
hydro-dev/Hydro のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
-
希望给编辑器加个选择,可回到旧版オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
希望比赛赛制增加CCPC新赛制オープン
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
hydro-dev/Hydro の issue をすべて見る
似ている issue
-
generate_image reference URL guard lets through IPv4-mapped IPv6 hosts and 100.64.0.0/10対応中かも @goranai が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
Inbox permission: an allow sent with `updatedInput` is ignored by Claude Code on its own safety checks対応中かも @Raj1v が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
backnotprop/plannotator#4046 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
traPtitech/knoQ_R-UI#290 ·
メンテナーはふだん 24 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
farion1231/cc-switch#9981 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
account bug course exam iris lecture
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信