「每次提起升版就被已讀。」
Ruby 3.2 導入了重要的 Regexp 更新,而隨著 Ruby 4 發佈,Ruby 3.2 也正式進入 EOL。近年的 Ruby Regexp 改善,也讓 ReDoS 的防禦逐漸從「怎麼寫 Regex」延伸到「底層如何幫開發者收斂風險」。
然而, 2026 年初 GitLab 的 CVE-2026-1388,以及 Active Support 的 CVE-2026-33169,也再次提醒我們:在複雜的 Web 應用實作中,Regexp 仍然可能成為效能與安全問題的入口。
這場演講會延續 RubyJam 3 月 Meetup 中對 Ruby Feature #17837 與 #19104 的設計權衡討論,並加入 2026 年最新的技術動態:
1. 案例拆解:分析 ReDoS CVE 案例,看看在現有防護機制下,哪些模式依然可能帶來風險。
2. Rails 實踐:說明如何在 Rails 應用程式中整合 Regexp Timeout。
3. 從 ReDoS 延伸到 Timing Attack:回應 RubyJam Meetup 的現場提問,聊聊演算法複雜度攻擊的另一面,以及 Ruby 生態系中如何實作 Constant Time Comparison。
4. Ruby Regexp 的最新方向:分享來自 RubyKaigi 2026 的第一手資訊,看看 Regexp 導入 JIT 的進展,以及對安全性議題的可能影響。
• COSCUP 2026 官網: https://coscup.org/2026/session/FYSGQ8
---
Diving into Ruby's ReDoS Defense: Design Trade-offs, Rails Integration, and the Future of Regexp
"Left on read... every time I suggest a version upgrade."
Ruby 3.2 introduced significant improvements to Regexp security and performance. With Ruby 4 recently released and Ruby 3.2 now officially reaching EOL, the community’s approach to ReDoS (Regular Expression Denial of Service) has gradually extended from “how do we write safe Regex” to “how can the runtime itself help reduce risk for developers.”
However, the CVE-2026-1388 incident in GitLab and CVE-2026-33169 in Active Support in early 2026 once again remind us that in real-world web applications, Regexp can still become an unexpected source of performance and security issues.
This talk continues the discussion from the RubyJam 2026.03 Meetup around Ruby Feature #17837 and #19104, and extends it with the latest developments in 2026:
1. Case breakdown: Analyzing two ReDoS-related CVEs, and examining which Regexp patterns can still introduce risk under existing mitigation mechanisms.
2. Rails in practice: How to integrate Regexp Timeout into Rails applications, and what practical pitfalls to watch out for.
3. From ReDoS to Timing Attacks: Following up on questions from the RubyJam Meetup, exploring the other side of algorithmic complexity attacks, and how Ruby ecosystems implement Constant Time Comparison.
4. The latest direction of Ruby Regexp: First-hand insights from RubyKaigi 2026, looking into the ongoing progress of introducing JIT into Regexp and what it may imply for security considerations going forward.
• COSCUP 2026 Official Website: https://coscup.org/2026/en/session/FYSGQ8