Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

GHSA-7gcf-g7xr-8hxj: serde_with: KeyValueMap serialization panics on empty sequence or map entries

0
Medium
Published: 07/15/2026 (07/15/2026, 22:41:01 UTC)
Source: GCVE Database
Product: serde_with

Description

The serde_with crate contains a vulnerability in its KeyValueMap serializer that causes a panic when serializing empty sequences or map entries. This occurs because the serializer incorrectly assumes each mapped element has at least one field or item and subtracts one from the length before validation. An attacker able to control serialized data using KeyValueMap can trigger a denial of service by causing the process to crash during serialization.

CVSS v4.0

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vuln. Confidentiality
None
Vuln. Integrity
None
Vuln. Availability
Low
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N

Affected software

crates.ioghsa
serde_with
Affected versions
<3.21.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/16/2026, 10:49:31 UTC

Technical Analysis

The KeyValueMap serializer in serde_with versions prior to 3.21.0 improperly handles empty inner sequences or map entries by preallocating a vector with a capacity of length minus one without verifying the presence of required key fields. This leads to a panic during serialization when an empty entry is encountered. The vulnerability can be triggered via serde_json::to_string or any Serde serializer that uses KeyValueMap, allowing an attacker controlling serialized data to cause a denial of service by crashing the process.

Potential Impact

A local attacker who can supply attacker-controlled data for serialization using the KeyValueMap serializer can cause the application to panic and terminate, resulting in a denial of service. There is no indication of privilege escalation, data disclosure, or remote code execution.

Mitigation Recommendations

No official patch or fix is currently confirmed. Users should check the vendor advisory for updates. Until a fix is available, avoid serializing untrusted or attacker-controlled data with KeyValueMap or implement input validation to ensure no empty sequences or map entries are serialized.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-7gcf-g7xr-8hxj
Osv Schema Version
1.4.0
Aliases
[]
Ecosystems
["crates.io"]
Database Specific Severity
MODERATE
Cvss Version
4.0

Threat ID: 6a58b40568715ace43d67084

Added to database: 07/16/2026, 10:35:49 UTC

Last enriched: 07/16/2026, 10:49:31 UTC

Last updated: 07/17/2026, 03:39:46 UTC

Views: 4

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses