POJIA破甲
地图 / URI parser's RFC3986 regular expression has poor performance when there are two # characters, leading to ReDoS

URI parser's RFC3986 regular expression has poor performance when there are two # characters, leading to ReDoS

拒绝服务 / Unlabeled / #1444501

厂商
Ruby
严重程度
低危 · CVSS 5.3
赏金
—
弱点
Unlabeled
研究员
@dee-see
披露日期
2023-12-13
资产
https://github.com/ruby/ruby
CVE
CVE-2023-28755

该报告还没有中文解读。

原文摘录

摘自原文(1640 字符中的一小部分)
Hello team, I hope you're doing well! The `URI` parser mishandles invalid URLs that have two `#` characters. It does correctly identify that they're invalid, but the regex performs very poorly and execution time grows much faster than the string length.
原文中的代码
require 'benchmark'
require 'uri'

def parse(n)
  URI('https://example.com/dir/' + 'a' * n + '/##.jpg')
  rescue URI::InvalidURIError
  # Invalid URI because of the two #
end

n = 50000
Benchmark.bm(7) do |x|
  x.report('Base length') { parse(n) }
  x.report('Length x2  ') { parse(n * 2) } …

默认不展示报告全文。以上为简短摘录,完整复现过程请阅读原文。版权归研究员与 Ruby 所有。

时间线

  • 报告提交
  • 公开披露
阅读 HackerOne 原文 ↗作者 @dee-see · 版权归作者与 Ruby 所有

同类报告

Circular based introspetion Query leading to single request denial of service and cost consumption and query cost on api.sorare.com/graphqlSorare · 2024-10-17ReDoS Vulnerability in HTTP Accept Headers ParsingInternet Bug Bounty · 2024-10-30 · $2,642ReDoS in IPAddrRuby · 2025-07-08ReDoS in PsychRuby · 2025-07-08Unbounded decompression chain in HTTP responses on Node.js Fetch API via Content-Encoding leads to resource exhaustionNode.js · 2026-02-23ASGIRequest header concatenation quadratic CPU DoS on Django via repeated headers leads to worker exhaustionDjango · 2026-02-09