Regex size limit bypass via json.match_schema and Azure RBAC StringMatches
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
src/builtins/objects.rs の compile_json_schema 周辺と src/languages/azure_rbac/builtins/strings.rs:86 を読み、続いて compile_regex_for_builtin() と jsonschema バリデーターの設定を調べてください。json.match_schema/json.verify_schema と Azure RBAC StringMatches の両方が、JSON Schema を通じて提供されるパターンを含め、同じ regex サイズ制限を適用することを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Summary
PR #705 adds compiled-size limits to all regex.* builtins via compile_regex_for_builtin(). However, two other code paths accept user-controlled regex patterns without enforcing the same limit:
1. json.match_schema / json.verify_schema
- Path:
src/builtins/objects.rs→compile_json_schema→jsonschema::validator_for - Issue: JSON Schema
"pattern"keywords contain regex patterns that are compiled by thejsonschemacrate internally, bypassing ourRegexBuilder::size_limit()enforcement. - Risk: A policy author can embed an adversarial regex inside a JSON schema pattern to circumvent the size limit.
2. Azure RBAC StringMatches
- Path:
src/languages/azure_rbac/builtins/strings.rs:86 - Issue: Uses
Regex::new()directly without size limit. - Risk: Feature-gated behind
azure_rbac, but if enabled with untrusted conditions, the same class of adversarial patterns applies.
Suggested Fix
- For
json.match_schema: Configure thejsonschemacrate to use a custom regex provider that enforces the same size limit, or pre-validate schema patterns before compilation. - For Azure RBAC: Route through
compile_regex_for_builtin()or applyRegexBuilder::size_limit()directly.
Context
Found during multi-model review of #705. These are separate code paths from the regex.* builtins and would be best addressed in a follow-up PR.
- 主要言語
- Rust
- スター
- 375
- フォーク
- 81
- 平均マージ
- 1日 11時間
- マージ済み PR(30日)
- 78
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/regorus のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
メンテナーはふだん 1 日以内に返信
-
RVM: errors and conflicts in rule bodies evaluate to undefined, even with strict builtin errors再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
microsoft/regorus#932 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 32/100
メンテナーはふだん 1 日以内に返信
microsoft/regorus の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
awxkee/yuvutils-rs#149 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
Ignore entry for RUSTSEC-2026-0002 no longer matches anything (`lru` is no longer in `Cargo.lock`)オープン
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
influxdata/influxdb#27767 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
shell-pool/shpool#463 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
oras-project/rust-oci-client-node#132 ·
メンテナーはふだん 2 日以内に返信