CVE-2026-83742
published medium CVSS 4.0 · 5.3wstrncat() unsigned integer underflow leads to an off-by-one null write in wolfSSH on non-Windows platforms
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| wolfSSL Inc. | — | wolfSSH1.4.11 through 1.5.0 (affected · semver); changes: unaffected at 1.6.0 · Other versions: unaffected | Version-specific | Not stated | wolfSSL |
| Alpine Linux | edge | wolfssh | Fixed | 1.6.0-r0 | Package fix record |
| Alpine Linux | v3.24 | wolfssh | Fixed | 1.6.0-r0 | Package fix record |
Description
Unsigned integer underflow in wstrncat() in src/port.c in wolfSSL wolfSSH from v1.4.11 through v1.5.0 on non-Windows platforms allows an authenticated remote attacker to write one out-of-bounds null byte past the end of a stack buffer by sending a crafted SFTP path. wolfSSH_RealPath() in src/ssh.c appends each path component with a remaining-size bound (outSz - curSz) rather than the full destination size, so once the accumulated path reaches half the output buffer the size_t computation n - strlen(s1) - 1 wraps to near SIZE_MAX. The strncat() call is then effectively unbounded and copies the whole component; when that component exactly fills the remainder of the buffer, its terminating null is written one byte past the end. The caller's own length check keeps the copied data inside the buffer, so the overflow is limited to that single null byte, which may corrupt an adjacent stack value and crash the process. Applications that call the public wolfSSH_RealPath() with an output buffer smaller than the input path are additionally exposed to an unbounded copy, because the word32 expression outSz - segSz in that length check also wraps.
Related advisories
Vendor advisories explicitly linked to this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 4.0
- Base score
- 5.3 / 10
- Severity
- medium
- Provider
- wolfSSL · cna
- Vector string
- CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N/AU:N
- Scenarios
- en: GENERAL
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| wolfSSL Inc. | wolfSSH | 1.4.11 through 1.5.0 (affected · semver); changes: unaffected at 1.6.0Default: unaffected | wolfSSL · cna |
Weaknesses
3- CWE-191 CWE-191 Integer Underflow (Wrap or Wraparound)
- CWE-121 CWE-121 Stack-based Buffer Overflow
- CWE-193 CWE-193 Off-by-one Error
References
4- Fix commit 513e52b1 (bounded scan replacing strlen in wstrncat) https://github.com/wolfSSL/wolfssh/commit/513e52b18927a4e3f7cf17ecaf107958e56139de
- Fix commit 822e4464 (guard the free space calculation in wstrncat) https://github.com/wolfSSL/wolfssh/commit/822e4464560b467580ea37a2fc03b0988d88b71f
- Hardening commit fbc7cd88 (wolfSSH_RealPath length check and append bounds) https://github.com/wolfSSL/wolfssh/commit/fbc7cd88a23b59a45a584020a4c7242d9bd70f35
- Fix PR #1084 https://github.com/wolfSSL/wolfssh/pull/1084
Provider assertions
2wolfSSL · cna
wstrncat() unsigned integer underflow leads to an off-by-one null write in wolfSSH on non-Windows platforms
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 336e37cfcdfd39dd724c6e8561c711962feaee38cce8374abb41bd8549909ad2
- Ingested
- 07 Oct 2026, 11:56:50 UTC
- Source record
- Official CVE record