# GHSA-pcqq-5962-hvcw: Denial of Service in uap-core when processing crafted User-Agent strings

> Remote attackers can cause denial of service in applications using uap-core by sending crafted User-Agent strings that trigger regex backtracking.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 10 Mar 2020

## What is GHSA-pcqq-5962-hvcw?

GHSA-pcqq-5962-hvcw is a denial of service vulnerability in user_agent_parser, published on 10 Mar 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

### Impact
Some regexes are vulnerable to regular expression denial of service (REDoS) due to overlapping capture groups. This allows remote attackers to overload a server by setting the User-Agent header in an HTTP(S) request to maliciously crafted long strings.

### Patches
Please update `uap-ruby` to &gt;= v2.6.0

### For more information
https://github.com/ua-parser/uap-core/security/advisories/GHSA-cmcx-xhr8-3w9p

Reported in `uap-core` by Ben Caller @bcaller

## Which versions are affected by GHSA-pcqq-5962-hvcw?

2 open source packages ship an affected version, including user_agent_parser.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `user_agent_parser` | RubyGems | All versions | 2.6.0 |
| `user_agent_parser` | RubyGems | All versions | 2.6.0 |

## How do I fix GHSA-pcqq-5962-hvcw?

Upgrade user_agent_parser to 2.6.0 or later.

## Is GHSA-pcqq-5962-hvcw being exploited?

There is no known exploitation of GHSA-pcqq-5962-hvcw in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-pcqq-5962-hvcw and fix it if it is affected.

What it is: GHSA-pcqq-5962-hvcw is a denial of service vulnerability in user_agent_parser, published on 10 Mar 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-pcqq-5962-hvcw in the wild and no public exploit code.

Affected packages and fixed versions:
- user_agent_parser (RubyGems): affected all versions; fixed in 2.6.0
- user_agent_parser (RubyGems): affected all versions; fixed in 2.6.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-pcqq-5962-hvcw/ (Markdown: https://insights.sbomify.com/GHSA-pcqq-5962-hvcw/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-pcqq-5962-hvcw

---
From sbomify Insights: https://insights.sbomify.com/GHSA-pcqq-5962-hvcw/
Summaries are generated and may contain mistakes; the official description above is the record.
