Add settings for alias limits, recursion, and duplicate keys
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
從 Composer.java 中的 SnakeYAML Engine composer 入口以及現有的 Psych 程式碼點限制測試開始。比較 JRuby 的 parser、composer/node 處理和 C Psych 實作如何偵測別名、遞迴鍵和重複鍵;要完成此項工作,需要 maintainer 釐清應由哪一層負責這些設定,並加入測試來驗證所選擇的行為。
由索引模型根據 Issue 內容生成。
描述
In #613 and #647 I exposed settings in SnakeYAML Engine for limiting code points, aliases, recursive keys, and duplicate keys.
I was able to add one test that worked, for the code point limit setting. I could not get the others to error, and I think I've figured out why: they are not done at the parser level.
The maximum alias detection, for example, which is used to prevent the "billion laughs" attack, is done above the parser in SnakeYAML Engine as part of composing YAML nodes for the rest of the library. JRuby's Psych backend bypasses the composer/node API and uses the parser directly, with the node-wrangling logic living in the rest of Psych.
I suspect this is the same situation for the duplicate and recursive keys, but hopefully @asomov can tell us if this is the case.
If so, then three out of the four settings I added are not really being used by SnakeYAML Engine, and they should be changed into Psych-level settings. However I am not sure how the C version of Psych detects and prevents these situations. Need clarification from @tenderlove or @hsbt.
Alternatively, it may make sense for the SnakeYAML Engine parser itself to honor these settings, but that would be up to @asomov.
- 主要語言
- Ruby
- 星號
- 596
- 分支
- 228
- 平均合併
- 24 分鐘
- 30 天內合併 PR
- 5
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
ruby/psych 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 83/100
維護者通常 1 天內回覆
-
Sexagesimal scalars are mis-scanned可能已有人在做 @ihamzatarar 於 14 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
Documentation
難度 1/5 1 小時以內 新手友好度 72/100
維護者通常 1 天內回覆
-
Psych.dump raises Encoding::CompatibilityError for UTF-16/UTF-32 strings可能已有人在做 @Halvanhelv 於 83 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 55/100
維護者通常 1 天內回覆
-
Psych::Emitter#start_document: tag-directive handles and prefixes are aliased as raw `char *`, and the Strings die inside the loop可能已有人在做 @ninjapanzer 於 14 天前認領。 未關閉
難度 4/5 3-5 天 新手友好度 68/100
維護者通常 1 天內回覆
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
🐛 bug 👩💻 équipe CE
難度 2/5 1-3 小時 新手友好度 68/100
betagouv/conseillers-entreprises#4835 ·
維護者通常 1 天內回覆
-
backlog enhancement github_actions priority: low risk: low
難度 2/5 1-3 小時 新手友好度 77/100
davidteren/mutineer#646 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 62/100
metanorma/isodoc#965 · 1 則留言 ·
維護者通常 1 天內回覆