<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="/static/style.xsl" type="text/xsl"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
  <channel>
    <title>Most recent entries from all</title>
    <link>https://db.gcve.eu</link>
    <description>Contains only the most 10 recent entries.</description>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>python-feedgen</generator>
    <language>en</language>
    <lastBuildDate>Fri, 02 Oct 2026 07:59:04 +0000</lastBuildDate>
    <item>
      <title>GHSA-7gcf-g7xr-8hxj — serde_with: KeyValueMap serialization panics on empty sequence or map entries</title>
      <link>https://db.gcve.eu/vuln/ghsa-7gcf-g7xr-8hxj</link>
      <description>&lt;p&gt;&lt;strong&gt;Affected:&lt;/strong&gt; crates.io: serde_with&lt;/p&gt;
&lt;p&gt;### Summary&lt;/p&gt;
&lt;p&gt;The public `KeyValueMap` serializer assumes that each mapped element has at least one field or item to use as the map key, but it subtracts `1` from the caller-visible length before validating that assumption. An application that serializes attacker-controlled data through `#[serde_as(as = &amp;#34;KeyValueMap&amp;lt;_&amp;gt;&amp;#34;)]` can be crashed by an empty inner sequence or map entry.&lt;/p&gt;
&lt;p&gt;### Details&lt;/p&gt;
&lt;p&gt;The affected public surface includes:&lt;/p&gt;
&lt;p&gt;- Serialization of `#[serde_as(as = &amp;#34;KeyValueMap&amp;lt;_&amp;gt;&amp;#34;)]` values through `serde_json::to_string` or any other Serde serializer`
- Public `KeyValueMap` conversions for sequence and map-backed entries`&lt;/p&gt;
&lt;p&gt;The root cause is: The `KeyValueMap` serializer preallocating `Vec::with_capacity(len - 1)` or `Vec::with_capacity(len.unwrap_or(17) - 1)` before checking that the element actually contains the required first key field or item.&lt;/p&gt;
&lt;p&gt;The vulnerable data/control flow is: attacker-controlled empty entry -&amp;gt; `serde_json::to_string` -&amp;gt; `KeyValueMap&amp;lt;TAs&amp;gt;::serialize_as` -&amp;gt; `SeqAsMapSerializer::{serialize_seq,serialize_map}` -&amp;gt; `Vec::with_capacity(len - 1)` or `Vec::with_capacity(len.unwrap_or(17) - 1)` -&amp;gt; panic&lt;/p&gt;
&lt;p&gt;Relevant source locations:&lt;/p&gt;
&lt;p&gt;- `serde_with/src/key_value_map.rs:590`
- `serde_with/src/key_value_map.rs:599`
- `serde_with/src/key_value_map.rs:613`
- `serde_with/src/key_value_map.rs:632`
- `serde_with/src/key_value_map.rs:648`&lt;/p&gt;
&lt;p&gt;### PoC&lt;/p&gt;
&lt;p&gt;```rust
/*
[dependencies]
serde = {version = &amp;#34;*&amp;#34;, features = [&amp;#34;derive&amp;#34;]}
serde_with = &amp;#34;*&amp;#34;
serde_json = &amp;#34;*&amp;#34;
*/&lt;/p&gt;
&lt;p&gt;use serde::S…&lt;/p&gt;</description>
      <content:encoded>&lt;p&gt;&lt;strong&gt;Affected:&lt;/strong&gt; crates.io: serde_with&lt;/p&gt;
&lt;p&gt;### Summary&lt;/p&gt;
&lt;p&gt;The public `KeyValueMap` serializer assumes that each mapped element has at least one field or item to use as the map key, but it subtracts `1` from the caller-visible length before validating that assumption. An application that serializes attacker-controlled data through `#[serde_as(as = &amp;#34;KeyValueMap&amp;lt;_&amp;gt;&amp;#34;)]` can be crashed by an empty inner sequence or map entry.&lt;/p&gt;
&lt;p&gt;### Details&lt;/p&gt;
&lt;p&gt;The affected public surface includes:&lt;/p&gt;
&lt;p&gt;- Serialization of `#[serde_as(as = &amp;#34;KeyValueMap&amp;lt;_&amp;gt;&amp;#34;)]` values through `serde_json::to_string` or any other Serde serializer`
- Public `KeyValueMap` conversions for sequence and map-backed entries`&lt;/p&gt;
&lt;p&gt;The root cause is: The `KeyValueMap` serializer preallocating `Vec::with_capacity(len - 1)` or `Vec::with_capacity(len.unwrap_or(17) - 1)` before checking that the element actually contains the required first key field or item.&lt;/p&gt;
&lt;p&gt;The vulnerable data/control flow is: attacker-controlled empty entry -&amp;gt; `serde_json::to_string` -&amp;gt; `KeyValueMap&amp;lt;TAs&amp;gt;::serialize_as` -&amp;gt; `SeqAsMapSerializer::{serialize_seq,serialize_map}` -&amp;gt; `Vec::with_capacity(len - 1)` or `Vec::with_capacity(len.unwrap_or(17) - 1)` -&amp;gt; panic&lt;/p&gt;
&lt;p&gt;Relevant source locations:&lt;/p&gt;
&lt;p&gt;- `serde_with/src/key_value_map.rs:590`
- `serde_with/src/key_value_map.rs:599`
- `serde_with/src/key_value_map.rs:613`
- `serde_with/src/key_value_map.rs:632`
- `serde_with/src/key_value_map.rs:648`&lt;/p&gt;
&lt;p&gt;### PoC&lt;/p&gt;
&lt;p&gt;```rust
/*
[dependencies]
serde = {version = &amp;#34;*&amp;#34;, features = [&amp;#34;derive&amp;#34;]}
serde_with = &amp;#34;*&amp;#34;
serde_json = &amp;#34;*&amp;#34;
*/&lt;/p&gt;
&lt;p&gt;use serde::S…&lt;/p&gt;</content:encoded>
      <guid isPermaLink="false">https://db.gcve.eu/vuln/ghsa-7gcf-g7xr-8hxj</guid>
    </item>
  </channel>
</rss>
