@angular/common: Denial of Service (DoS) via OOM in Date Formatting (formatDate)GHSA-48r7-hpm6-gfxm
HIGHFix: angular/angular#69197GHSA-48r7-hpm6-gfxm is a high-severity (CVSS 7.5) Uncontrolled Resource Consumption vulnerability in @angular/common. A fix is available for @angular/common — see the affected versions and patch details below.
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-48r7-hpm6-gfxm.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
@angular/commonnpmDescription
A Denial of Service (DoS) vulnerability exists in the @angular/common package of the Angular framework. The formatDate function, which is also utilized by the standard Angular DatePipe, does not properly limit or validate the length of the format parameter.
When parsing a maliciously crafted, excessively long date format string (e.g., a repeating pattern or very large string), the internal parser splits the string iteratively using a regular expression loop. This results in uncontrolled resource consumption (high CPU utilization and excessive memory allocations), leading to a Denial of Service (DoS).
Impact
1. Server-Side Rendering (SSR)
In Angular applications that leverage Server-Side Rendering, an attacker can supply a malicious payload with an excessively long date format string. Processing this on the server causes high CPU usage and triggers a JavaScript heap out of memory crash, rendering the application unavailable to all users.
2. Client-Side Rendering (CSR)
In standard client-side applications, executing the vulnerable function with an excessively long format string blocks the browser's main thread, causing the browser tab to freeze and become completely unresponsive.
Patched Versions
- 22.0.1
- 21.2.17
- 20.3.25
Attack Preconditions
For this vulnerability to be exploitable, both of the following conditions must be met:
- Vulnerable Component Usage: The application must format dates using the
formatDateutility or theDatePipe. - Attacker-Controlled Parameter: The date format string passed to these utilities must be customizable or directly controlled by untrusted user input (e.g., parsed from query parameters, user preferences, or API responses).
If the date format is hardcoded (e.g., 'mediumDate', 'shortTime', or static strings) or properly validated to be within a reasonable length limit, the application is not vulnerable.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | @angular/common | ≥ 22.0.0-next.0&&< 22.0.1 | 22.0.1npm install @angular/common@22.0.1 |
| 📦npm | @angular/common | ≥ 21.0.0-next.0&&< 21.2.17 | 21.2.17npm install @angular/common@21.2.17 |
| 📦npm | @angular/common | ≥ 20.0.0-next.0&&< 20.3.25 | 20.3.25npm install @angular/common@20.3.25 |
| 📦npm | @angular/common | all versions | No fix |
Affected Products
angularangularDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @angular/common, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update @angular/common to 22.0.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-48r7-hpm6-gfxm is resolved across your whole dependency graph.
Workarounds
Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
A flaw was found in Angular's @angular/common DatePipe. A crafted date format string can cause excessive CPU consumption, resulting in a denial of service. Red Hat Integration Service Registry includes @angular/common in its UI components and is affected by this vulnerability. Most other Red Hat products matched by…
Validate and sanitize user-supplied date format strings before passing them to Angular's DatePipe. Implement request rate limiting and timeouts on web application endpoints to limit the impact of malicious requests.Source: Red Hat security advisory for GHSA-48r7-hpm6-gfxm (CC BY 4.0)
Frequently Asked Questions
Is GHSA-48r7-hpm6-gfxm in your dependencies?
Find it across npm, including transitive dependencies.