Security context

What an agent needs to avoid regressing past fixes and find the next vuln in this repo.

ruby/date
master @ 58d1ba6
2
Fixes
1
CVEs
HIGH
Peak severity
50.0%
Coverage
Highlights
Buffer Overflow: 1 prior fix. Scrutinize any change in this area.
ext/date/date_parse.c: most-fixed (1 issue). Treat as high-risk during review.
2 high-severity fixes in this history; regressions here are high-impact.
Recurring patterns

The bug types that recur here, drawn from past fixes, not open vulnerabilities.

Buffer Overflow: Format string operations with overly large precision parameters can bypass implicit size allocations, risking stack or heap buffer overflows during string formatting in date_strftime_with_tmx. Ensure strict upper bounds validation on precision values before formatting.
Memory Corruption: Parsing invalid timezone representations can cause out-of-bounds memory reads during comparison. Additionally, temporary string buffers passed to native parsers risk being prematurely garbage-collected by the Ruby VM if they are not explicitly guarded, leading to use-after-free vulnerabilities.
Regular Expression Denial of Service (ReDoS): The Date.parse method has historically used regular expressions vulnerable to catastrophic backtracking when evaluated against specially crafted long input strings, permitting denial-of-service (DoS) attacks.