CWE-194
Weakness AllowedUnexpected Sign Extension
Abstraction: Variant · Status: Incomplete
The product performs an operation on a number that causes it to be sign extended when it is transformed into a larger data type.
Mapping guidance
This CWE entry is at the Variant level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.
Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.
Relationships and members
Modes of introduction
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.)
Notes
Relationship
Sign extension errors can lead to buffer overflows and other memory-based problems. They are also likely to be factors in other weaknesses that are not based on memory operations, but rely on numeric calculation.
Maintenance
This entry is closely associated with signed-to-unsigned conversion errors (CWE-195) and other numeric errors. These relationships need to be more closely examined within CWE.
Content history
updated Applicable_Platforms, Common_Consequences, Description, Relationships, Taxonomy_Mappings
complete rewrite of the entire entry
updated Common_Consequences, Demonstrative_Examples, Description, Maintenance_Notes, Name, Observed_Examples, Potential_Mitigations, References, Relationship_Notes, Relationships
updated Demonstrative_Examples
updated Demonstrative_Examples
updated Demonstrative_Examples
updated Applicable_Platforms
updated Common_Consequences
updated Demonstrative_Examples, Relationships
updated Relationships, Taxonomy_Mappings
updated References, Taxonomy_Mappings
updated Relationships
updated Relationships
updated Observed_Examples
updated Relationships
updated Relationships
updated Potential_Mitigations, References
updated Description
updated References, Relationships
updated Mapping_Notes
updated Detection_Factors, Weakness_Ordinalities
updated Common_Consequences, Description, References
12 vulnerabilities reference this CWE, most recent first.
GHSA-RQ4P-MWVQ-FHVQ
Vulnerability from github – Published: 2022-05-24 19:17 – Updated: 2022-05-24 19:17FATEK Automation WinProladder versions 3.30 and prior lacks proper validation of user-supplied data when parsing project files, which could result in an unexpected sign extension. An attacker could leverage this vulnerability to execute arbitrary code.
{
"affected": [],
"aliases": [
"CVE-2021-38434"
],
"database_specific": {
"cwe_ids": [
"CWE-194"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2021-10-18T13:15:00Z",
"severity": "HIGH"
},
"details": "FATEK Automation WinProladder versions 3.30 and prior lacks proper validation of user-supplied data when parsing project files, which could result in an unexpected sign extension. An attacker could leverage this vulnerability to execute arbitrary code.",
"id": "GHSA-rq4p-mwvq-fhvq",
"modified": "2022-05-24T19:17:49Z",
"published": "2022-05-24T19:17:49Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-38434"
},
{
"type": "WEB",
"url": "https://us-cert.cisa.gov/ics/advisories/icsa-21-280-06"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-V5CJ-RQ82-C9M7
Vulnerability from github – Published: 2026-11-10 18:31 – Updated: 2026-11-10 18:31In Eclipse Kura versions 3.1.0 to 5.6.2, the iBeacon and Eddystone advertisement decoders wrongly parse the AD-structure length field of an over-the-air BLE advertising payload. Any unauthenticated attacker within BLE radio range can broadcast a two-byte advertising payload that drives the Kura beacon-scanner thread into a tight infinite loop, pinning a CPU core and permanently halting beacon ingestion until the gateway is restarted. To trigger the attack, the iBeacon/Eddystone scanner component should be installed and active. By default the components are not installed or enabled.
{
"affected": [],
"aliases": [
"CVE-2026-97402"
],
"database_specific": {
"cwe_ids": [
"CWE-194"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-11-10T16:17:25Z",
"severity": "LOW"
},
"details": "In Eclipse Kura versions 3.1.0 to 5.6.2, the iBeacon and Eddystone advertisement decoders wrongly parse the AD-structure length field of an over-the-air BLE advertising payload. Any unauthenticated attacker within BLE radio range can broadcast a two-byte advertising payload that drives the Kura beacon-scanner thread into a tight infinite loop, pinning a CPU core and permanently halting beacon ingestion until the gateway is restarted. To trigger the attack, the iBeacon/Eddystone scanner component should be installed and active. By default the components are not installed or enabled.",
"id": "GHSA-v5cj-rq82-c9m7",
"modified": "2026-11-10T18:31:42Z",
"published": "2026-11-10T18:31:42Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/eclipse-kura/kura/security/advisories/GHSA-x83q-g5h7-ffc5"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-97402"
},
{
"type": "WEB",
"url": "https://gitlab.eclipse.org/security/cve-assignment/-/work_items/322"
},
{
"type": "WEB",
"url": "https://gitlab.eclipse.org/security/vulnerability-reports/-/work_items/923"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:A/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:L/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
"type": "CVSS_V4"
}
]
}
Mitigation
Avoid using signed variables if you don't need to represent negative values. When negative values are needed, perform validation after you save those values to larger data types, or before passing them to functions that are expecting unsigned values.
No CAPEC attack patterns related to this CWE.