Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CWE-462 (在关联列表中具有重复Key) — Vulnerability Class 1

1 vulnerabilities classified as CWE-462 (在关联列表中具有重复Key). AI Chinese analysis included.

CWE-462 represents a data structure weakness where an associative list contains multiple entries with identical keys, creating ambiguity in value retrieval. This flaw typically arises from programming errors rather than malicious exploitation, as attackers rarely target this specific structural issue directly. However, the presence of duplicate keys can lead to unpredictable behavior, such as returning the first or last inserted value, which may cause logic errors or security bypasses if the application assumes key uniqueness. To prevent this, developers should enforce strict validation mechanisms that reject duplicate key insertions during runtime. Utilizing robust data structures like hash maps with unique constraints or implementing explicit error handling for key collisions ensures data integrity and eliminates the ambiguity inherent in flawed associative list implementations.

MITRE CWE Description
Duplicate keys in associative lists can lead to non-unique keys being mistaken for an error. A duplicate key entry -- if the alist is designed properly -- could be used as a constant time replace function. However, duplicate key entries could be inserted by mistake. Because of this ambiguity, duplicate key entries in an association list are not recommended and should not be allowed.
Common Consequences (1)
OtherQuality Degradation, Varies by Context
Mitigations (2)
Architecture and DesignUse a hash table instead of an alist.
Architecture and DesignUse an alist which checks the uniqueness of hash keys with each entry before inserting the entry.
Examples (1)
The following code adds data to a list and then attempts to sort the data.
alist = [] while (foo()): #now assume there is a string data with a key basename queue.append(basename,data) queue.sort()
Bad · Python
CVE IDTitleCVSSSeverityPublished
CVE-2025-21085 PingFederate OAuth Grant attribute duplication may use excessive memory — PingFederate 7.5AIHighAI2025-06-15

Vulnerabilities classified as CWE-462 (在关联列表中具有重复Key) represent 1 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.