CWE-252
Weakness AllowedUnchecked Return Value
Abstraction: Base · Status: Draft
The product does not check the return value from a method or function.
Mapping guidance
This CWE entry is at the Base 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
Two common programmer assumptions are "this function call can never fail" and "it doesn't matter if this function call fails". If an attacker can force the function to fail or otherwise return a value that is not expected, then the subsequent program logic could lead to a vulnerability.
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.)
Effectiveness: High
Content history
Provided Demonstrative Example and suggested CERT reference
updated Common_Consequences, Relationships, Other_Notes, Taxonomy_Mappings
updated Relationships, Taxonomy_Mappings
updated Background_Details, Demonstrative_Examples, Description, Observed_Examples, Other_Notes, Potential_Mitigations
updated Relationships
updated Demonstrative_Examples
updated Demonstrative_Examples
updated Common_Consequences, Demonstrative_Examples, References
updated Demonstrative_Examples, Potential_Mitigations, References
updated Demonstrative_Examples
updated Demonstrative_Examples, References
updated Observed_Examples
updated Demonstrative_Examples
updated Common_Consequences, Demonstrative_Examples, Relationships, Taxonomy_Mappings
updated Common_Consequences
updated Relationships, Taxonomy_Mappings
updated Common_Consequences, References, Relationships
updated Demonstrative_Examples, Potential_Mitigations
updated Demonstrative_Examples, Relationships, Taxonomy_Mappings
updated Applicable_Platforms, References, Relationships, Taxonomy_Mappings
updated References
updated References, Relationships, Taxonomy_Mappings
updated Relationships
updated References
updated Observed_Examples
updated Relationships
updated Demonstrative_Examples, Observed_Examples, Relationships, Weakness_Ordinalities
updated Observed_Examples
updated Description
updated Detection_Factors, Relationships
updated Mapping_Notes, Relationships
updated Observed_Examples
updated Potential_Mitigations, References
updated Relationships
updated Applicable_Platforms, Common_Consequences, Description, Modes_of_Introduction, References, Relationships, Taxonomy_Mappings
319 vulnerabilities reference this CWE, most recent first.
GHSA-GR75-MCWQ-HXV5
Vulnerability from github – Published: 2026-01-22 15:31 – Updated: 2026-01-22 15:31GitLab has remediated an issue in GitLab CE/EE affecting all versions from 18.6 before 18.6.4, 18.7 before 18.7.2, and 18.8 before 18.8.2 that could have allowed an individual with existing knowledge of a victim's credential ID to bypass two-factor authentication by submitting forged device responses.
{
"affected": [],
"aliases": [
"CVE-2026-0723"
],
"database_specific": {
"cwe_ids": [
"CWE-252"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-01-22T15:16:50Z",
"severity": "HIGH"
},
"details": "GitLab has remediated an issue in GitLab CE/EE affecting all versions from 18.6 before 18.6.4, 18.7 before 18.7.2, and 18.8 before 18.8.2 that could have allowed an individual with existing knowledge of a victim\u0027s credential ID to bypass two-factor authentication by submitting forged device responses.",
"id": "GHSA-gr75-mcwq-hxv5",
"modified": "2026-01-22T15:31:32Z",
"published": "2026-01-22T15:31:32Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-0723"
},
{
"type": "WEB",
"url": "https://hackerone.com/reports/3476052"
},
{
"type": "WEB",
"url": "https://about.gitlab.com/releases/2026/01/21/patch-release-gitlab-18-8-2-released"
},
{
"type": "WEB",
"url": "https://gitlab.com/gitlab-org/gitlab/-/issues/585333"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-GRC3-8Q8M-4J7C
Vulnerability from github – Published: 2022-02-09 22:37 – Updated: 2024-01-31 15:12Apache Accumulo versions 1.5.0 through 1.10.0 and version 2.0.0 do not properly check the return value of some policy enforcement functions before permitting an authenticated user to perform certain administrative operations. Specifically, the return values of the 'canFlush' and 'canPerformSystemActions' security functions are not checked in some instances, therefore allowing an authenticated user with insufficient permissions to perform the following actions: flushing a table, shutting down Accumulo or an individual tablet server, and setting or removing system-wide Accumulo configuration properties.
{
"affected": [
{
"package": {
"ecosystem": "Maven",
"name": "org.apache.accumulo:accumulo-master"
},
"ranges": [
{
"events": [
{
"introduced": "1.5.0"
},
{
"fixed": "1.10.1"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Maven",
"name": "org.apache.accumulo:accumulo-master"
},
"ranges": [
{
"events": [
{
"introduced": "2.0.0"
},
{
"fixed": "2.0.1"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"2.0.0"
]
}
],
"aliases": [
"CVE-2020-17533"
],
"database_specific": {
"cwe_ids": [
"CWE-252",
"CWE-280",
"CWE-732"
],
"github_reviewed": true,
"github_reviewed_at": "2021-04-07T22:41:39Z",
"nvd_published_at": "2020-12-29T12:15:00Z",
"severity": "HIGH"
},
"details": "Apache Accumulo versions 1.5.0 through 1.10.0 and version 2.0.0 do not properly check the return value of some policy enforcement functions before permitting an authenticated user to perform certain administrative operations. Specifically, the return values of the \u0027canFlush\u0027 and \u0027canPerformSystemActions\u0027 security functions are not checked in some instances, therefore allowing an authenticated user with insufficient permissions to perform the following actions: flushing a table, shutting down Accumulo or an individual tablet server, and setting or removing system-wide Accumulo configuration properties.",
"id": "GHSA-grc3-8q8m-4j7c",
"modified": "2024-01-31T15:12:56Z",
"published": "2022-02-09T22:37:59Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2020-17533"
},
{
"type": "WEB",
"url": "https://github.com/apache/accumulo/commit/56142a89952533fef922fa86739a879c073e7c2a"
},
{
"type": "WEB",
"url": "https://github.com/apache/accumulo/commit/877ad502f6857e48342664e4b0ce83db74e4cda4"
},
{
"type": "PACKAGE",
"url": "https://github.com/apache/accumulo"
},
{
"type": "WEB",
"url": "https://lists.apache.org/thread.html/rf8c1a787b6951d3dacb9ec58f0bf1633790c91f54ff10c6f8ff9d8ed%40%3Cannounce.apache.org%3E"
},
{
"type": "WEB",
"url": "https://lists.apache.org/thread.html/rf8c1a787b6951d3dacb9ec58f0bf1633790c91f54ff10c6f8ff9d8ed%40%3Cuser.accumulo.apache.org%3E"
},
{
"type": "WEB",
"url": "https://lists.apache.org/thread.html/rf8c1a787b6951d3dacb9ec58f0bf1633790c91f54ff10c6f8ff9d8ed@%3Cannounce.apache.org%3E"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2020/12/29/1"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "Improper privilege handling in Apache Accumulo"
}
GHSA-GRH8-RG86-H558
Vulnerability from github – Published: 2024-08-14 15:31 – Updated: 2025-11-04 00:31Unchecked return value in firmware for some Intel(R) CSME may allow an unauthenticated user to potentially enable escalation of privilege via physical access.
{
"affected": [],
"aliases": [
"CVE-2023-40067"
],
"database_specific": {
"cwe_ids": [
"CWE-252"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-08-14T14:15:13Z",
"severity": "MODERATE"
},
"details": "Unchecked return value in firmware for some Intel(R) CSME may allow an unauthenticated user to potentially enable escalation of privilege via physical access.",
"id": "GHSA-grh8-rg86-h558",
"modified": "2025-11-04T00:31:11Z",
"published": "2024-08-14T15:31:12Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-40067"
},
{
"type": "WEB",
"url": "https://security.netapp.com/advisory/ntap-20241108-0003"
},
{
"type": "WEB",
"url": "https://www.intel.com/content/www/us/en/security-center/advisory/intel-sa-00999.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:P/AC:H/PR:N/UI:N/S:C/C:L/I:H/A:N",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:P/AC:H/AT:P/PR:N/UI:N/VC:N/VI:H/VA:N/SC:L/SI:H/SA:N/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"
}
]
}
GHSA-GRP6-R7RQ-FPC3
Vulnerability from github – Published: 2022-05-13 01:21 – Updated: 2022-05-13 01:21In Wireshark 3.0.0, the TSDNS dissector could crash. This was addressed in epan/dissectors/packet-tsdns.c by splitting strings safely.
{
"affected": [],
"aliases": [
"CVE-2019-10902"
],
"database_specific": {
"cwe_ids": [
"CWE-252"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2019-04-09T04:29:00Z",
"severity": "HIGH"
},
"details": "In Wireshark 3.0.0, the TSDNS dissector could crash. This was addressed in epan/dissectors/packet-tsdns.c by splitting strings safely.",
"id": "GHSA-grp6-r7rq-fpc3",
"modified": "2022-05-13T01:21:57Z",
"published": "2022-05-13T01:21:57Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2019-10902"
},
{
"type": "WEB",
"url": "https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=15619"
},
{
"type": "WEB",
"url": "https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=95571f17d5e2de39735e62e5251583f930c06d51"
},
{
"type": "WEB",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/4LYIOOQIMFQ3PA7AFBK4DNXHISTEYUC5"
},
{
"type": "WEB",
"url": "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PU3QA2DUO3XS24QE24CQRP4A4XQQY76R"
},
{
"type": "WEB",
"url": "https://www.wireshark.org/security/wnpa-sec-2019-16.html"
},
{
"type": "WEB",
"url": "http://lists.opensuse.org/opensuse-security-announce/2020-03/msg00027.html"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/107836"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-H47X-XW68-3M46
Vulnerability from github – Published: 2022-05-13 01:46 – Updated: 2025-04-20 03:34dmcrypt-get-device, as shipped in the eject package of Debian and Ubuntu, does not check the return value of the (1) setuid or (2) setgid function, which might cause dmcrypt-get-device to execute code, which was intended to run as an unprivileged user, as root. This affects eject through 2.1.5+deb1+cvs20081104-13.1 on Debian, eject before 2.1.5+deb1+cvs20081104-13.1ubuntu0.16.10.1 on Ubuntu 16.10, eject before 2.1.5+deb1+cvs20081104-13.1ubuntu0.16.04.1 on Ubuntu 16.04 LTS, eject before 2.1.5+deb1+cvs20081104-13.1ubuntu0.14.04.1 on Ubuntu 14.04 LTS, and eject before 2.1.5+deb1+cvs20081104-9ubuntu0.1 on Ubuntu 12.04 LTS.
{
"affected": [],
"aliases": [
"CVE-2017-6964"
],
"database_specific": {
"cwe_ids": [
"CWE-252"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2017-03-28T01:59:00Z",
"severity": "HIGH"
},
"details": "dmcrypt-get-device, as shipped in the eject package of Debian and Ubuntu, does not check the return value of the (1) setuid or (2) setgid function, which might cause dmcrypt-get-device to execute code, which was intended to run as an unprivileged user, as root. This affects eject through 2.1.5+deb1+cvs20081104-13.1 on Debian, eject before 2.1.5+deb1+cvs20081104-13.1ubuntu0.16.10.1 on Ubuntu 16.10, eject before 2.1.5+deb1+cvs20081104-13.1ubuntu0.16.04.1 on Ubuntu 16.04 LTS, eject before 2.1.5+deb1+cvs20081104-13.1ubuntu0.14.04.1 on Ubuntu 14.04 LTS, and eject before 2.1.5+deb1+cvs20081104-9ubuntu0.1 on Ubuntu 12.04 LTS.",
"id": "GHSA-h47x-xw68-3m46",
"modified": "2025-04-20T03:34:56Z",
"published": "2022-05-13T01:46:49Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2017-6964"
},
{
"type": "WEB",
"url": "https://launchpad.net/bugs/1673627"
},
{
"type": "WEB",
"url": "https://www.debian.org/security/2017/dsa-3823"
},
{
"type": "WEB",
"url": "https://www.ubuntu.com/usn/usn-3246-1"
},
{
"type": "WEB",
"url": "http://www.debian.org/security/2017/dsa-3823"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/97154"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-HC4M-RWG6-QP5M
Vulnerability from github – Published: 2026-11-30 09:31 – Updated: 2026-11-30 09:31The affected products do not properly handle certain return values generated during TCP connection processing. An unauthenticated remote attacker can send specially crafted TCP connection requests that cause the affected service to stop listening for new connections, resulting in a denial-of-service condition.
{
"affected": [],
"aliases": [
"CVE-2026-127169"
],
"database_specific": {
"cwe_ids": [
"CWE-252"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-11-30T09:17:20Z",
"severity": "HIGH"
},
"details": "The affected products do not properly handle certain return values generated during TCP connection processing. An unauthenticated remote attacker can send specially crafted TCP connection requests that cause the affected service to stop listening for new connections, resulting in a denial-of-service condition.",
"id": "GHSA-hc4m-rwg6-qp5m",
"modified": "2026-11-30T09:31:21Z",
"published": "2026-11-30T09:31:21Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-127169"
},
{
"type": "WEB",
"url": "https://www.certvde.com/en/advisories/VDE-2026-171"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/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"
}
]
}
GHSA-HJ9C-QX2W-G7MH
Vulnerability from github – Published: 2026-11-19 22:43 – Updated: 2026-11-19 22:43Summary
The three-argument xOnlyPointAddTweakCheck path ignores the wasm failure return and compares an unchanged input buffer. When the tweak result is the point at infinity, this stale-buffer comparison can return true for an invalid derivation.
Details
xOnlyPointAddTweakCheck in index.ts has two code paths. The path taken when the caller omits tweakParity discards the return value of the wasm call and compares whatever the shared input buffer holds.
try {
X_ONLY_PUBLIC_KEY_INPUT.set(point);
X_ONLY_PUBLIC_KEY_INPUT2.set(resultToCheck);
TWEAK_INPUT.set(tweak);
if (hasParity) {
return wasm.xOnlyPointAddTweakCheck(tweakParity) === 1;
} else {
wasm.xOnlyPointAddTweak();
const newKey = X_ONLY_PUBLIC_KEY_INPUT.slice(
0,
validate.X_ONLY_PUBLIC_KEY_SIZE
);
return compare(newKey, resultToCheck) === 0;
}
x_only_point_add_tweak in lib.rs returns -1 and leaves X_ONLY_PUBLIC_KEY_INPUT untouched when the tweak addition fails.
pub extern "C" fn x_only_point_add_tweak() -> i32 {
unsafe {
let mut xonly_pk = jstry!(x_only_pubkey_parse(X_ONLY_PUBLIC_KEY_INPUT.as_ptr()), 0);
let mut pubkey = PublicKey::new();
if secp256k1_xonly_pubkey_tweak_add(
get_context(),
&mut pubkey,
&xonly_pk,
TWEAK_INPUT.as_ptr(),
) != 1
{
// infinity point
return -1;
}
The buffer still holds point, which the caller wrote immediately before the call. newKey therefore equals point, and the comparison against resultToCheck succeeds whenever the caller passes resultToCheck equal to point.
secp256k1_xonly_pubkey_tweak_add in upstream main_impl.h returns 0 only when the internal key fails to load or the tweak helper fails.
if (!secp256k1_xonly_pubkey_load(ctx, &pk, internal_pubkey)
|| !secp256k1_ec_pubkey_tweak_add_helper(&pk, tweak32)) {
return 0;
}
The helper in secp256k1.c fails on scalar overflow or on an infinite result.
static int secp256k1_ec_pubkey_tweak_add_helper(secp256k1_ge *p, const unsigned char *tweak32) {
secp256k1_scalar term;
int overflow = 0;
secp256k1_scalar_set_b32(&term, tweak32, &overflow);
return !overflow && secp256k1_eckey_pubkey_tweak_add(p, &term);
}
validateTweak in validate.ts already rejects a tweak at or above the group order, so overflow is excluded and the only remaining cause is lift_x(point) + tweak * G reaching the point at infinity.
The parity path is correct for the same input. secp256k1_xonly_pubkey_tweak_add_check returns 0 in that case. The two documented forms of the same check disagree.
xOnlyPointAddTweak also disagrees with the check, returning null for the exact inputs the check accepts.
The condition is untested. schnorr.js skips every xOnlyPointAddTweakCheck assertion for the infinity vectors present in its own fixtures.
const res = secp256k1.xOnlyPointAddTweak(f.pubkey, f.tweak);
if (f.result === null) {
t.same(res, f.result, `xOnlyPointAddTweak returns null when G pubkey and n - 1 tweak used`);
continue;
}
PoC
Both witnesses are already present in the project fixtures at schnorr.json as the two vectors with a null result, and both pass every validator in validate.ts.
import * as secp256k1 from "tiny-secp256k1";
const hex = (s) => Uint8Array.from(Buffer.from(s, "hex"));
// x coordinate of G, and the tweak n - 1
const point = hex("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798");
const tweak = hex("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140");
// lift_x(point) + tweak * G is the point at infinity, no tweaked key exists
console.log(secp256k1.xOnlyPointAddTweak(point, tweak));
// null
console.log(secp256k1.xOnlyPointAddTweakCheck(point, tweak, point, 0));
// false correct, the parity form uses the C check
console.log(secp256k1.xOnlyPointAddTweakCheck(point, tweak, point));
// true wrong, the three argument form compares point against itself
A second witness from the same fixture uses the x coordinate of 2 * G with tweak n - 2.
const point2 = hex("c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5");
const tweak2 = hex("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413f");
console.log(secp256k1.xOnlyPointAddTweakCheck(point2, tweak2, point2)); // true
Both were executed against the published secp256k1.wasm from npm 2.2.4 under wasmtime, driving the exports through the exact write, call, slice, zero sequence index.ts performs.
-- witness x(G), n-1
xOnlyPointAddTweak(P, t) = None
check(P, t, P, parity=0) = False
check(P, t, P, parity=1) = False
check(P, t, P) 3-arg form = True
raw wasm return = -1
buffer after call unchanged = True 79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798
-- witness x(2G), n-2
xOnlyPointAddTweak(P, t) = None
check(P, t, P, parity=0) = False
check(P, t, P, parity=1) = False
check(P, t, P) 3-arg form = True
raw wasm return = -1
buffer after call unchanged = True c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5
-- control, ordinary tweak 5 on x(G)
xOnlyPointAddTweak = (1, 'fff97bd5755eeea420453a14355235d382f6472f8568a18b2f057a1460297556')
check 3-arg with correct result = True
check 3-arg with wrong result = False
The control confirms the three argument form is otherwise correct, so the defect is specific to the failure path.
An attacker generated witness follows the same construction with a hash derived tweak.
tweak = 2ae431167097f01e131d3e3fd000044e79eb64f5391d594ec311d4a56a38c1e3
point = d14530c85d0169da4e4be4642f2cdaad14fb0421b690df617d00366b5f1ca832
lift_x(point) + tweak * G = infinity
xOnlyPointAddTweakCheck(point, tweak, point) === true
Impact
The three-argument helper can return true for an internal key and tweak whose derived point is at infinity. Protocols that use this result to validate a derived output can accept an invalid key when the caller controls the point, tweak, and comparison value.
Affected versions
tiny-secp256k1: 2.1.0 through 2.2.4.@bitcoin-js/tiny-secp256k1-asmjs: 2.2.2 through 2.2.4.
The xOnlyPointAddTweakCheck API first appears in tiny-secp256k1 2.1.0. Static inspection of the integrity-checked asm.js releases confirms the same ignored return value and unchanged-buffer path when the tweak result is infinity. The WASM reproduction above is not an asm.js runtime measurement.
Remediation
Upgrade tiny-secp256k1 and @bitcoin-js/tiny-secp256k1-asmjs, as applicable, to 2.2.5 or a later patched release. The path without tweakParity now checks the backend's failure result before reading and comparing the output buffer. A tweak that produces the point at infinity returns false.
References
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "tiny-secp256k1"
},
"ranges": [
{
"events": [
{
"introduced": "2.1.0"
},
{
"fixed": "2.2.5"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "npm",
"name": "@bitcoin-js/tiny-secp256k1-asmjs"
},
"ranges": [
{
"events": [
{
"introduced": "2.2.2"
},
{
"fixed": "2.2.5"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-107853"
],
"database_specific": {
"cwe_ids": [
"CWE-252"
],
"github_reviewed": true,
"github_reviewed_at": "2026-11-19T22:43:45Z",
"nvd_published_at": "2026-11-17T20:17:35Z",
"severity": "MODERATE"
},
"details": "### Summary\nThe three-argument `xOnlyPointAddTweakCheck` path ignores the wasm failure return and compares an unchanged input buffer. When the tweak result is the point at infinity, this stale-buffer comparison can return `true` for an invalid derivation.\n\n### Details\n`xOnlyPointAddTweakCheck` in `index.ts` has two code paths. The path taken when the caller omits `tweakParity` discards the return value of the wasm call and compares whatever the shared input buffer holds.\n\n```ts\ntry {\n X_ONLY_PUBLIC_KEY_INPUT.set(point);\n X_ONLY_PUBLIC_KEY_INPUT2.set(resultToCheck);\n TWEAK_INPUT.set(tweak);\n if (hasParity) {\n return wasm.xOnlyPointAddTweakCheck(tweakParity) === 1;\n } else {\n wasm.xOnlyPointAddTweak();\n const newKey = X_ONLY_PUBLIC_KEY_INPUT.slice(\n 0,\n validate.X_ONLY_PUBLIC_KEY_SIZE\n );\n return compare(newKey, resultToCheck) === 0;\n }\n```\n\n`x_only_point_add_tweak` in `lib.rs` returns `-1` and leaves `X_ONLY_PUBLIC_KEY_INPUT` untouched when the tweak addition fails.\n\n```rust\npub extern \"C\" fn x_only_point_add_tweak() -\u003e i32 {\n unsafe {\n let mut xonly_pk = jstry!(x_only_pubkey_parse(X_ONLY_PUBLIC_KEY_INPUT.as_ptr()), 0);\n let mut pubkey = PublicKey::new();\n if secp256k1_xonly_pubkey_tweak_add(\n get_context(),\n \u0026mut pubkey,\n \u0026xonly_pk,\n TWEAK_INPUT.as_ptr(),\n ) != 1\n {\n // infinity point\n return -1;\n }\n```\n\nThe buffer still holds `point`, which the caller wrote immediately before the call. `newKey` therefore equals `point`, and the comparison against `resultToCheck` succeeds whenever the caller passes `resultToCheck` equal to `point`.\n\n`secp256k1_xonly_pubkey_tweak_add` in upstream `main_impl.h` returns 0 only when the internal key fails to load or the tweak helper fails.\n\n```c\nif (!secp256k1_xonly_pubkey_load(ctx, \u0026pk, internal_pubkey)\n || !secp256k1_ec_pubkey_tweak_add_helper(\u0026pk, tweak32)) {\n return 0;\n}\n```\n\nThe helper in `secp256k1.c` fails on scalar overflow or on an infinite result.\n\n```c\nstatic int secp256k1_ec_pubkey_tweak_add_helper(secp256k1_ge *p, const unsigned char *tweak32) {\n secp256k1_scalar term;\n int overflow = 0;\n secp256k1_scalar_set_b32(\u0026term, tweak32, \u0026overflow);\n return !overflow \u0026\u0026 secp256k1_eckey_pubkey_tweak_add(p, \u0026term);\n}\n```\n\n`validateTweak` in `validate.ts` already rejects a tweak at or above the group order, so overflow is excluded and the only remaining cause is `lift_x(point) + tweak * G` reaching the point at infinity.\n\nThe parity path is correct for the same input. `secp256k1_xonly_pubkey_tweak_add_check` returns 0 in that case. The two documented forms of the same check disagree.\n\n`xOnlyPointAddTweak` also disagrees with the check, returning `null` for the exact inputs the check accepts.\n\nThe condition is untested. `schnorr.js` skips every `xOnlyPointAddTweakCheck` assertion for the infinity vectors present in its own fixtures.\n\n```js\nconst res = secp256k1.xOnlyPointAddTweak(f.pubkey, f.tweak);\nif (f.result === null) {\n t.same(res, f.result, `xOnlyPointAddTweak returns null when G pubkey and n - 1 tweak used`);\n continue;\n}\n```\n\n### PoC\nBoth witnesses are already present in the project fixtures at `schnorr.json` as the two vectors with a null result, and both pass every validator in `validate.ts`.\n\n```js\nimport * as secp256k1 from \"tiny-secp256k1\";\n\nconst hex = (s) =\u003e Uint8Array.from(Buffer.from(s, \"hex\"));\n\n// x coordinate of G, and the tweak n - 1\nconst point = hex(\"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798\");\nconst tweak = hex(\"fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140\");\n\n// lift_x(point) + tweak * G is the point at infinity, no tweaked key exists\nconsole.log(secp256k1.xOnlyPointAddTweak(point, tweak));\n// null\n\nconsole.log(secp256k1.xOnlyPointAddTweakCheck(point, tweak, point, 0));\n// false correct, the parity form uses the C check\n\nconsole.log(secp256k1.xOnlyPointAddTweakCheck(point, tweak, point));\n// true wrong, the three argument form compares point against itself\n```\n\nA second witness from the same fixture uses the x coordinate of `2 * G` with tweak `n - 2`.\n\n```js\nconst point2 = hex(\"c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5\");\nconst tweak2 = hex(\"fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd036413f\");\nconsole.log(secp256k1.xOnlyPointAddTweakCheck(point2, tweak2, point2)); // true\n```\n\nBoth were executed against the published `secp256k1.wasm` from npm 2.2.4 under `wasmtime`, driving the exports through the exact write, call, slice, zero sequence `index.ts` performs.\n\n```\n-- witness x(G), n-1\n xOnlyPointAddTweak(P, t) = None\n check(P, t, P, parity=0) = False\n check(P, t, P, parity=1) = False\n check(P, t, P) 3-arg form = True\n raw wasm return = -1\n buffer after call unchanged = True 79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798\n\n-- witness x(2G), n-2\n xOnlyPointAddTweak(P, t) = None\n check(P, t, P, parity=0) = False\n check(P, t, P, parity=1) = False\n check(P, t, P) 3-arg form = True\n raw wasm return = -1\n buffer after call unchanged = True c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5\n\n-- control, ordinary tweak 5 on x(G)\n xOnlyPointAddTweak = (1, \u0027fff97bd5755eeea420453a14355235d382f6472f8568a18b2f057a1460297556\u0027)\n check 3-arg with correct result = True\n check 3-arg with wrong result = False\n```\n\nThe control confirms the three argument form is otherwise correct, so the defect is specific to the failure path.\n\nAn attacker generated witness follows the same construction with a hash derived tweak.\n\n```\ntweak = 2ae431167097f01e131d3e3fd000044e79eb64f5391d594ec311d4a56a38c1e3\npoint = d14530c85d0169da4e4be4642f2cdaad14fb0421b690df617d00366b5f1ca832\nlift_x(point) + tweak * G = infinity\nxOnlyPointAddTweakCheck(point, tweak, point) === true\n```\n\n### Impact\nThe three-argument helper can return `true` for an internal key and tweak whose derived point is at infinity. Protocols that use this result to validate a derived output can accept an invalid key when the caller controls the point, tweak, and comparison value.\n\n### Affected versions\n\n- `tiny-secp256k1`: 2.1.0 through 2.2.4.\n- `@bitcoin-js/tiny-secp256k1-asmjs`: 2.2.2 through 2.2.4.\n\nThe `xOnlyPointAddTweakCheck` API first appears in tiny-secp256k1 2.1.0. Static inspection of the integrity-checked asm.js releases confirms the same ignored return value and unchanged-buffer path when the tweak result is infinity. The WASM reproduction above is not an asm.js runtime measurement.\n\n### Remediation\n\nUpgrade `tiny-secp256k1` and `@bitcoin-js/tiny-secp256k1-asmjs`, as applicable, to 2.2.5 or a later patched release. The path without `tweakParity` now checks the backend\u0027s failure result before reading and comparing the output buffer. A tweak that produces the point at infinity returns `false`.\n\n### References\n\n- [Fix: Reject failed infinity tweaks before comparing the output](https://github.com/bitcoinjs/tiny-secp256k1/commit/ba1af1fceea95967a172c6438ed9302730bb7c01)",
"id": "GHSA-hj9c-qx2w-g7mh",
"modified": "2026-11-19T22:43:45Z",
"published": "2026-11-19T22:43:45Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/bitcoinjs/tiny-secp256k1/security/advisories/GHSA-hj9c-qx2w-g7mh"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-107853"
},
{
"type": "WEB",
"url": "https://github.com/bitcoinjs/tiny-secp256k1/commit/ba1af1fceea95967a172c6438ed9302730bb7c01"
},
{
"type": "PACKAGE",
"url": "https://github.com/bitcoinjs/tiny-secp256k1"
},
{
"type": "WEB",
"url": "https://github.com/bitcoinjs/tiny-secp256k1/releases/tag/v2.2.5"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/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"
}
],
"summary": "tiny-secp256k1: Stale buffer after ignored wasm failure accepts invalid infinity tweak"
}
GHSA-HJWW-HMP9-XPPJ
Vulnerability from github – Published: 2026-03-25 12:30 – Updated: 2026-05-28 15:39In the Linux kernel, the following vulnerability has been resolved:
ASoC: SDCA: Add allocation failure check for Entity name
Currently find_sdca_entity_iot() can allocate a string for the Entity name but it doesn't check if that allocation succeeded. Add the missing NULL check after the allocation.
{
"affected": [],
"aliases": [
"CVE-2026-23301"
],
"database_specific": {
"cwe_ids": [
"CWE-252"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-03-25T11:16:25Z",
"severity": "MODERATE"
},
"details": "In the Linux kernel, the following vulnerability has been resolved:\n\nASoC: SDCA: Add allocation failure check for Entity name\n\nCurrently find_sdca_entity_iot() can allocate a string for the\nEntity name but it doesn\u0027t check if that allocation succeeded.\nAdd the missing NULL check after the allocation.",
"id": "GHSA-hjww-hmp9-xppj",
"modified": "2026-05-28T15:39:37Z",
"published": "2026-03-25T12:30:22Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-23301"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/27990181031fdcdbe0f7c46011f6404e5d116386"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/bdcc10a86055beb7109a786d94abf5626f375bbd"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-HPC3-58QP-H295
Vulnerability from github – Published: 2023-02-18 00:31 – Updated: 2023-02-28 21:30HyperKit is a toolkit for embedding hypervisor capabilities in an application. In versions 0.20210107 and prior of HyperKit, the implementation of qnotify at pci_vtrnd_notify fails to check the return value of vq_getchain. This leads to struct iovec iov; being uninitialized and used to read memory in len = (int) read(sc->vrsc_fd, iov.iov_base, iov.iov_len); when an attacker is able to make vq_getchain fail. This issue may lead to a guest crashing the host causing a denial of service and, under certain circumstance, memory corruption. This issue is fixed in commit 41272a980197917df8e58ff90642d14dec8fe948.
{
"affected": [],
"aliases": [
"CVE-2021-32845"
],
"database_specific": {
"cwe_ids": [
"CWE-252",
"CWE-908"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-02-17T23:15:00Z",
"severity": "HIGH"
},
"details": "HyperKit is a toolkit for embedding hypervisor capabilities in an application. In versions 0.20210107 and prior of HyperKit, the implementation of `qnotify` at `pci_vtrnd_notify` fails to check the return value of `vq_getchain`. This leads to `struct iovec iov;` being uninitialized and used to read memory in `len = (int) read(sc-\u003evrsc_fd, iov.iov_base, iov.iov_len);` when an attacker is able to make `vq_getchain` fail. This issue may lead to a guest crashing the host causing a denial of service and, under certain circumstance, memory corruption. This issue is fixed in commit 41272a980197917df8e58ff90642d14dec8fe948.",
"id": "GHSA-hpc3-58qp-h295",
"modified": "2023-02-28T21:30:17Z",
"published": "2023-02-18T00:31:58Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-32845"
},
{
"type": "WEB",
"url": "https://github.com/moby/hyperkit/pull/313"
},
{
"type": "WEB",
"url": "https://github.com/moby/hyperkit/commit/41272a980197917df8e58ff90642d14dec8fe948"
},
{
"type": "ADVISORY",
"url": "https://securitylab.github.com/advisories/GHSL-2021-054_057-moby-hyperkit"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-HW3P-W63H-MJ9C
Vulnerability from github – Published: 2022-05-24 17:37 – Updated: 2022-05-24 17:37An issue was discovered in LINBIT csync2 through 2.0. It does not correctly check for the return value GNUTLS_E_WARNING_ALERT_RECEIVED of the gnutls_handshake() function. It neglects to call this function again, as required by the design of the API.
{
"affected": [],
"aliases": [
"CVE-2019-15523"
],
"database_specific": {
"cwe_ids": [
"CWE-252"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2020-12-30T21:15:00Z",
"severity": "MODERATE"
},
"details": "An issue was discovered in LINBIT csync2 through 2.0. It does not correctly check for the return value GNUTLS_E_WARNING_ALERT_RECEIVED of the gnutls_handshake() function. It neglects to call this function again, as required by the design of the API.",
"id": "GHSA-hw3p-w63h-mj9c",
"modified": "2022-05-24T17:37:34Z",
"published": "2022-05-24T17:37:34Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2019-15523"
},
{
"type": "WEB",
"url": "https://github.com/LINBIT/csync2/pull/13/commits/92742544a56bcbcd9ec99ca15f898b31797e39e2"
},
{
"type": "WEB",
"url": "https://lists.debian.org/debian-lts-announce/2021/01/msg00003.html"
}
],
"schema_version": "1.4.0",
"severity": []
}
Mitigation MIT-53
Check the results of all functions that return a value and verify that the value is expected.
Mitigation MIT-56
For any pointers that could have been modified or provided from a function that can return NULL, check the pointer for NULL before use. When working with a multithreaded or otherwise asynchronous environment, ensure that proper locking APIs are used to lock before the check, and unlock when it has finished [REF-1484].
Mitigation
Ensure that you account for all possible return values from the function.
Mitigation
When designing a function, make sure you return a value or throw an exception in case of an error.
No CAPEC attack patterns related to this CWE.