pupnp SDK
CVE-2026-41682
MEDIUM
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconSupply crafted URI with port > 65535
-
Deliveryparse_uri() passes value to atoi()
-
ExploitInteger truncation wraps port to low-numbered value
-
Installparse_hostport() accepts wrapped port without validation
-
C2Application initiates connection to unintended port
-
ExecuteBypass port-based access controls
-
ImpactAccess restricted internal service
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Signed/unsigned conversion safety
|
| Exploitation Conditions | The vulnerable code path is triggered whenever pupnp's parse_uri() processes a URI containing a port component with a value outside the valid 16-bit range (1-65535). In practice, this requires an attacker to control URI input that reaches parse_hostport() - for example, UPnP SUBSCRIBE callback URLs submitted by a control point, location headers in UPnP discovery (SSDP) responses, or control URLs in UPnP device description XML. Exploitation is limited to pupnp-based applications acting as UPnP control points or otherwise consuming externally supplied URIs with port components; purely passive UPnP device implementations that do not process callback/location URIs from untrusted peers have a reduced but not eliminated attack surface. The CVSS 4.0 vector PR:N/UI:N/AV:N confirms no authentication or user interaction is required when attacker-controlled URI input is reachable over the network. |
| Impact | The CVSS 4.0 score of 6.9 with AV:N/AC:L/PR:N/UI:N reflects a network-accessible, low-complexity, unauthenticated path to partial confidentiality and integrity impact. However, real-world exploitation risk is substantially below what that score implies. EPSS is 0.04% at the 12th percentile - near the floor of known CVEs - indicating negligible observed exploitation activity. CISA SSVC confirms exploitation status as 'none' while noting the attack is automatable, a combination that suggests the precondition (attacker-controlled URI input reaching parse_uri) limits practical reach even though exploitation mechanics themselves are straightforward. No KEV listing corroborates the absence of active campaigns. The key tension is SSVC 'automatable: yes' against EPSS near zero - this likely reflects that exploitation is easy once the precondition is met, but the precondition (externally supplied URIs processed by a pupnp control point) is not universally present. Defenders should prioritize patching in deployments where the application processes callback URLs or location headers from untrusted UPnP peers. |
| Exploit ScenarioDerived | An attacker sends a crafted UPnP SUBSCRIBE callback URI or device description location URL containing a port value such as 65537 to an application built on pupnp. The atoi() call in parse_hostport() produces a value that wraps to 1 after integer truncation, causing the UPnP control point to initiate a connection to port 1 on a target host rather than the stated port 65537. This bypasses port-based firewall rules or security checks that would have blocked access to the low-numbered port, potentially exposing internal administrative or legacy services. No public exploit code has been identified at time of analysis. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 24, 2026
Port confusion in pupnp's URI parser allows remote unauthenticated attackers to bypass port-based access controls by supplying port values exceeding 65535 in crafted URIs. The integer truncation caused by atoi() in parse_hostport() within uri.c causes the parsed port to wrap around (e.g., port 65537 resolves to port 1), enabling SSRF-style redirection to unintended internal services. All pupnp releases prior to 1.18.5 are affected; no confirmed active exploitation exists (EPSS 0.04%, no KEV listing), but SSVC rates the attack as automatable with partial technical impact.
RemediationAI
Upgrade pupnp to version 1.18.5, the confirmed patched release available at https://github.com/pupnp/pupnp/releases/tag/release-1.18.5, which introduces strtol()-based port parsing with explicit 1-65535 range validation in parse_hostport(). The underlying commit is https://github.com/pupnp/pupnp/commit/def5f9a2bc42f5b3d713e37c516fbe840ce54b7b. For deployments that cannot immediately upgrade, a compensating control is to validate and reject port values outside the 1-65535 range in application code before passing URIs to pupnp's parse_uri() - note this adds application-layer logic that must be maintained across future pupnp updates. Network-level egress filtering to block outbound connections from UPnP services to privileged ports (1-1023) can reduce the blast radius of successful exploitation but does not prevent the underlying integer confusion.
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The vulnerability (CWE-195: Signed to Unsigned Conversion Error) resides in parse_hostport() in upnp/src/genlib/net/uri/uri.c. The original code used atoi() to convert port strings from incoming URIs to integers. atoi() performs no range validation and its return value, when subsequently stored in or compared against a 16-bit unsigned port type, wraps modulo 65536 - so a supplied port of 65537 is silently treated as port 1. The fix (commit def5f9a2) replaces atoi() with strtol() and adds explicit bounds checking (1-65535), returning UPNP_E_INVALID_URL for out-of-range values. Affected CPE is cpe:2.3:a:pupnp:pupnp:*:*:*:*:*:*:*:* covering all versions prior to 1.18.5. pupnp (libupnp) is the reference open-source UPnP SDK embedded in many IoT devices, media servers, and smart home software.
Know when Pupnp gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N
Network-reachable URI parsing with no auth or interaction required; impact limited to partial SSRF-style port confusion affecting confidentiality and integrity only.
Primary rating from GitHub Advisory.
CVSS VectorGitHub Advisory
Lifecycle Timeline
2DescriptionGitHub Advisory
pupnp is an SDK for development of UPnP device and control point applications. Prior to version 1.18.5, pupnp is vulnerable to SRRF port confusion due to port truncation via atoi() cast in parse_uri(). This issue has been patched in version 1.18.5.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Affected Products (CPE)GitHub Advisory
A stack overflow in pupnp before version 1.14.5 can cause the denial of service through the Parser_parseDocument() funct
The Portable SDK for UPnP Devices is an SDK for development of UPnP device and control point applications. Rated critica
Denial of service in pupnp (libupnp) releases prior to 22.0.4 lets remote unauthenticated attackers stall the UPnP minis
Denial of service in pupnp (the portable UPnP SDK) versions prior to 2.0.2 allows unauthenticated remote attackers to ex
Denial of service in pupnp (portable UPnP SDK) versions prior to 2.0.2 affects remote, unauthenticated deployments whose
Integer overflow in pupnp's HTTP Content-Length parser (raw_to_int in upnp/src/genlib/net/http/httpparser.c) allows a re
Stack exhaustion in pupnp (libupnp) before 2.0.0 allows an unauthenticated attacker on the local or adjacent network to
Same weakness CWE-195 – Signed to Unsigned Conversion Error
View allSame technique Information Disclosure
View allVendor StatusVendor
SUSE
| Product | Status |
|---|---|
| openSUSE Tumbleweed | Fixed |
NVD
CVE.org
EPSS
Vulnrichment
GitHub
Exploit-DB