CWEweakness

CWE-195 Signed to Unsigned Conversion Error

Official page ↗
Abstraction
Variant
Structure
Simple
Status
Draft
Languages
C, C++
CWE version
5.0

Description

The product uses a signed primitive and performs a cast to an unsigned primitive, which can produce an unexpected value if the value of the signed primitive can not be represented using an unsigned primitive.

Common consequences

• Integrity: Unexpected State, Modify Memory, Read Memory — Conversion between signed and unsigned values can lead to a variety of errors, but from a security standpoint is most commonly associated with integer overflow and buffer overflow vulnerabilities. Often, functions will return negative values to indicate a failure. When the result of a function is to be used as a size parameter, using these negative return values can have unexpected results. For example, if negative size values are passed to the standard memory copy or allocation functions, they will be implicitly cast to a large unsigned value. This may lead to an exploitable buffer overflow or underflow condition.

Detection methods

• Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

Observed examples

• CVE-2025-27363: Font rendering library does not properly handle assigning a signed short value to an unsigned long (CWE-195), leading to an integer wraparound (CWE-190), causing too small of a buffer (CWE-131), leading to an out-of-bounds write (CWE-787). • CVE-2007-4268: Chain: integer signedness error (CWE-195) passes signed comparison, leading to heap overflow (CWE-122)

Related

Observed example · CVE (2)

  • CVE-2025-27363 An out of bounds write exists in FreeType versions 2.13.0 and below (newer versions of FreeType are not vulnerable) when attempting to… vulnerability
  • CVE-2007-4268 Integer signedness error in the Networking component in Apple Mac OS X 10.4 through 10.4.10 allows local users to execute arbitrary code… vulnerability

Can precede · CWE (1)

  • CWE-119 Improper Restriction of Operations within the Bounds of a Memory Buffer weakness

Child of · CWE (1)

  • CWE-681 Incorrect Conversion between Numeric Types weakness

Referenced by CVE · weakness (37)

  • CVE-2026-115678 Arm Keil MDK-Middleware 8.0.0-8.3.0 may allow pre-authentication out-of-bounds read in SNMP processing vulnerability
  • CVE-2026-115679 Arm Keil MDK-Middleware 8.3.0 may allow out-of-bounds reads and writes to the FTP Server RX Buffer vulnerability
  • CVE-2026-115921 Open Neural Network Exchange (ONNX) is an open standard for machine learning interoperability. vulnerability
  • CVE-2026-70388 SOEM version 2.0.0 and earlier contains vulnerabilities where a malicious device on the network can send specially crafted messages that… vulnerability
  • CVE-2026-82943 SOEM version 2.0.0 and earlier contains vulnerabilities where a malicious device can send messages that cause the master to read data from… vulnerability
  • CVE-2026-101937 A Signed to Unsigned Conversion Error vulnerability in the srxpfe of Juniper Networks Junos OS on the SRX Series allows an adjacent… vulnerability
  • CVE-2026-110735 Godot Engine through 4.7.2 has a heap out-of-bounds write in the binary resource loader (core/io/resource_format_binary.cpp,… vulnerability
  • CVE-2026-17507 In Bouncy Castle for Java before 1.86, the MLS implementation (org.bouncycastle.mls) holds RFC 9420's uint32 leaf_index in a signed int, so… vulnerability
  • CVE-2026-102639 MobilityDB version 1.3.0 and earlier contains an out-of-bounds read vulnerability in the MEOS binary and library WKB deserialization logic… vulnerability
  • CVE-2026-74220 U-Boot before 2026.10-rc5 contains a buffer overflow in nfs_read_reply() function in net/nfs-common.c that allows attackers to corrupt… vulnerability
  • CVE-2026-74221 U-Boot before 2026.10-rc5 contains a buffer overflow in nfs_readlink_reply() function in net/nfs-common.c when processing NFS server… vulnerability
  • CVE-2026-20248 A vulnerability in the DNS over TCP implementation of Cisco Secure Firewall Adaptive Security Appliance (ASA) Software and Cisco Secure… vulnerability
  • CVE-2026-77406 RabbitMQ amqp091-go is a Go AMQP 0.9.1 client. vulnerability
  • CVE-2026-85441 MOOS core-moos through 10.4.0 fails to validate that serialized string lengths are non-negative in CMOOSMsg::operator>>. vulnerability
  • CVE-2026-18444 There is an integer conversion vulnerability resulting in an out-of-bounds read when loading images recently discovered in NI LabVIEW. vulnerability
  • CVE-2026-62959 Coturn is a free open source implementation of TURN and STUN Server. vulnerability
  • CVE-2026-55737 Signed to Unsigned Conversion Error and Out-of-bounds Write vulnerability in Erlang OTP erts allows an attacker who can supply a crafted… vulnerability
  • CVE-2026-55991 In NLnet Labs Unbound 1.22.0 up to and including 1.25.1, a remote unauthenticated client can trigger a libngtcp2 assertion (if compiled… vulnerability
  • CVE-2026-49840 FreeSWITCH is a Software Defined Telecom Stack enabling the digital transformation from proprietary telecom switches to a software… vulnerability
  • CVE-2026-41682 pupnp is an SDK for development of UPnP device and control point applications. vulnerability
  • CVE-2026-26981 OpenEXR provides the specification and reference implementation of the EXR file format, an image storage format for the motion picture… vulnerability
  • CVE-2025-67897 In Sequoia before 2.1.0, aes_key_unwrap panics if passed a ciphertext that is too short. vulnerability
  • CVE-2025-65495 Integer signedness error in tls_verify_call_back() in src/coap_openssl.c in OISM libcoap 4.3.5 allows remote attackers to cause a denial of… vulnerability
  • CVE-2025-52566 llama.cpp is an inference of several LLM models in C/C++. vulnerability
  • CVE-2025-49847 llama.cpp is an inference of several LLM models in C/C++. vulnerability
  • CVE-2025-30646 A Signed to Unsigned Conversion Error vulnerability in the Layer 2 Control Protocol daemon (l2cpd) of Juniper Networks Junos OS and Juniper… vulnerability
  • CVE-2025-24792 Snowflake PHP PDO Driver is a driver that uses the PHP Data Objects (PDO) extension to connect to the Snowflake database. vulnerability
  • CVE-2024-25388 drivers/wlan/wlan_mgmt,c in RT-Thread through 5.0.2 has an integer signedness error and resultant buffer overflow. vulnerability
  • CVE-2023-28063 Dell BIOS contains a Signed to Unsigned Conversion Error vulnerability. vulnerability
  • CVE-2023-33034 Memory corruption while parsing the ADSP response command. vulnerability
Show all 37 ›

Referenced by CWE · can also be (1)

  • CWE-197 Numeric Truncation Error weakness

Referenced by CWE · can precede (1)

  • CWE-839 Numeric Range Comparison Without Minimum Check weakness