CVE-2026-73253
Executive Summary
CVE-2026-73253 is a hostname verification bypass vulnerability in the Mongoose embedded web server's built-in TLS implementation, affecting all versions prior to 7.22. An on-path network attacker who possesses a valid wildcard certificate for a parent domain (e.g., *.example.com) can impersonate arbitrary deeper subdomains (e.g., foo.bar.example.com) to a client that uses Mongoose's built-in TLS stack, enabling interception and modification of supposedly secure TLS traffic. The root cause is improper wildcard matching in the certificate SAN/CN verification logic, which allows a * wildcard to cross DNS label boundaries. This is a CWE-295 Improper Certificate Validation flaw, and while no public exploit or CISA KEV listing exists, any organization deploying Mongoose with built-in TLS in security-sensitive roles (e.g., IoT devices, edge gateways, network appliances) is potentially affected.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Technical Analysis
The vulnerability resides in the hostname verification logic of Mongoose's built-in TLS stack, specifically within the functions mg_tls_verify_cert_san() and mg_tls_verify_cert_cn() located in src/tls_builtin.c. These functions are responsible for validating that the hostname presented in the server's TLS certificate matches the hostname the client intended to connect to — a critical step in preventing man-in-the-middle attacks.
The flaw stems from the use of mg_match() for wildcard certificate matching. The mg_match() function implements glob-style pattern matching that does not respect DNS label boundaries. In standard TLS certificate validation (per RFC 6125 and the CA/Browser Forum Baseline Requirements), a wildcard certificate *.example.com is only valid for foo.example.com — a single label substitution. It must NOT match foo.bar.example.com, which represents a deeper subdomain requiring the wildcard to match against two label components.
However, because mg_match() treats the wildcard * as matching any sequence of characters including dots, the pattern *.example.com incorrectly matches foo.bar.example.com. This flaw enables a multi-level subdomain impersonation attack: an attacker who legitimately possesses (or has fraudulently obtained) a wildcard certificate for example.com can use it to impersonate api.internal.example.com, device.customer.example.com, or any arbitrarily deep subdomain of the parent domain.
The attack surface is the client-side TLS validation path — i.e., Mongoose acting as a TLS client. The built-in TLS stack (as opposed to integrating with OpenSSL or mbedTLS) is the affected component. The attack requires the attacker to be on-path (capable of intercepting and injecting network traffic between the Mongoose client and the legitimate server) and to possess a valid wildcard certificate for a parent domain of the target. This is feasible in scenarios involving compromised DNS, rogue wireless access points, or compromised network infrastructure.
No specific code-level proof-of-concept is publicly available, but the vulnerability class is well-understood: improper wildcard expansion in certificate hostname validation leading to a TLS identity spoofing condition.
Exploitation Scenarios
Prerequisites (as derived from the NVD description):
- An on-path network attacker (able to intercept and redirect traffic)
- A valid wildcard certificate for a parent domain of the target server (e.g.,
*.example.com) - A Mongoose-based TLS client using the built-in TLS stack, version < 7.22
Step 1 — Reconnaissance and Target Identification: The attacker identifies a target network where a Mongoose client device (e.g., an IoT sensor, embedded controller, or mobile app backend) makes TLS connections to a server. The attacker determines the server's hostname (e.g., data.internal.example.com) and identifies that the target client trusts certificates issued for *.example.com.
Step 2 — Triggering the Vulnerability: The attacker positions themselves on the network path (e.g., ARP spoofing, malicious DNS response, or rogue access point). The attacker obtains a valid wildcard certificate for the parent domain (e.g., *.example.com) from a public CA or a compromised private CA. When the Mongoose client attempts to connect to data.internal.example.com, the attacker intercepts the connection, presents the *.example.com certificate, and the vulnerable mg_tls_verify_cert_cn() / mg_tls_verify_cert_san() functions incorrectly accept it because *.example.com improperly matches data.internal.example.com.
Step 3 — Payload/Execution at Vulnerability-Class Level: At the vulnerability-class level (CWE-295 Improper Certificate Validation), the attacker completes the TLS handshake using their valid wildcard certificate. The client believes it is communicating with the legitimate server. The attacker establishes a MITM position, transparently decrypting traffic from the client and re-encrypting it to the real backend server (or terminating the connection entirely and serving fraudulent responses).
Step 4 — Post-Exploitation Impact: The attacker can read all data transmitted by the client (credentials, sensor data, API tokens, firmware update content) and can modify responses — e.g., injecting malicious firmware updates to IoT devices, altering sensor readings, hijacking OTA update channels, or committing credential theft. Because the client-side validation is bypassed, the MITM position remains undetected by the application layer, leaving no client-side error flags.
Note: No public PoC or exploit code is currently available. This attack chain is inferred from the vulnerability class and the NVD description. The difficulty is elevated by the requirement for a valid wildcard certificate and on-path network positioning (reflected in the AC:H factor in the CVSS vector).
Impact Assessment
Business Impact: CVE-2026-73253 compromises the integrity and confidentiality of all TLS communications involving affected Mongoose clients. Since Mongoose is widely embedded in IoT devices, automotive telematics, industrial control systems, and consumer routers, the impact spans multiple verticals. Compromised devices can leak sensitive telemetry, credentials, or firmware data, and can receive maliciously altered firmware or configuration, potentially leading to large-scale device compromise.
Affected Systems: All deployments using Mongoose built-in TLS built before version 7.22. Notably, systems that configure TLS client connections to subdomains (e.g., API endpoints, cloud connectors, OTA servers) are directly exposed. Systems using external TLS libraries (OpenSSL, mbedTLS) are unaffected.
Blast Radius: The CVSS vector AV:N/AC:H/PR:N/UI:N/C:H/I:H/A:N (as assigned per the metadata) yields a base score around 7.4 (High). The network attack vector and lack of user interaction make remote exploitation feasible, albeit with a High attack complexity due to the on-path requirement and certificate possession. The confidentiality and integrity impact are both High; availability is not directly affected. The lack of authentication requirement (PR:N) is offset by the complexity — an opportunistic attacker cannot exploit this without specific certificate material.
Data Exposure: Any cleartext data inside the TLS tunnel is exposed — PII, credentials, API keys, control commands, and firmware images. The ability to modify traffic enables supply-chain-style attacks on the device's software update pipeline.
Detection Guidance
The following detection rules target the signatures of this vulnerability's exploitation: unusual certificate SAN/CN patterns, MITM TLS handshake behaviors, and an abnormal frequency of TLS connections to a single host from a Mongoose client. Note that no active CVE-2026-73253 exploit traffic has been observed in the wild; these rules are proactive.
Sigma Rule
title: Mongoose TLS Certificate Hostname Verification Bypass (CVE-2026-73253)
id: e1f3a9c2-7b5d-4c8e-9a1f-6d2b8c4e5f10
status: experimental
description: Detects TLS client connections from Mongoose-based software where the presented certificate contains a wildcard SAN matching multiple DNS label depths, indicating potential CVE-2026-73253 exploitation.
logsource:
product: windows
category: network_connection
detection:
selection:
DestinationPort: 443
Initiated: 'true'
filter_wildcard_parent:
- Image|contains: 'mongoose' # process name common in embedded deployments
condition: selection and filter_wildcard_parent
fields:
- Image
- DestinationHostname
- DestinationIP
falsepositives:
- Legitimate uses of deep-subdomain wildcard certificates
- Embedded devices using Mongoose normally
level: medium
tags:
- attack.t1557
- cve.2026-73253
- cwe.295
YARA Rule
rule CVE_2026_73253_Mongoose_TLS_Wildcard_Bypass
{
meta:
author = "valtersit.com Threat Intel"
date = "2026-01-01"
description = "Detects binary strings indicating Mongoose built-in TLS with vulnerable wildcard matching logic (mg_match usage in cert verification)"
cve = "CVE-2026-73253"
reference = "src/tls_builtin.c"
strings:
$s1 = "mg_tls_verify_cert_san" ascii fullword
$s2 = "mg_tls_verify_cert_cn" ascii fullword
$s3 = "mg_match" ascii fullword
$s4 = "tls_builtin.c" ascii fullword
condition:
(uint16(0) == 0x5A4D or uint32(0) == 0x464C457F) and // PE or ELF binary
2 of ($s1, $s2) and any of ($s3, $s4)
}
Suricata IDS Rule
alert tls any any -> any any (msg:"Potential CVE-2026-73253 Mongoose TLS wildcard hostname bypass — TLS handshake with multi-label wildcard SAN"; flow:to_server; tls.store; tls.cert_issuer; tls.cert_subject; content:"|2a 2e|"; pcre:"/(?:[a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]+\.(?:com|net|org|io|dev|app)\x22/"; classtype:policy-violation; sid:10073253; rev:1; metadata:cve CVE-2026-73253, attack_target IoT, deployment Perimeter;)
Note: The Suricata rule matches TLS handshakes where the certificate subject/SAN contains a wildcard pattern *. (indicated by |2a 2e| = *.) followed by two or more DNS label dots, indicating potential deep-subdomain impersonation.
Elastic Detection
// EQL query for Elastic Defend/Endpoint — flag TLS connections with wildcard SANs to subdomains
sequence by process.entity_id
[network where destination.port == 443 and network.direction == "egress" and process.name : "*mongoose*"]
[file where event.action == "certificate" and file.name : "*cert*" and (file.content : "*.example.com" or file.content : "*.*.example.com")]
Note: The EQL rule assumes certificate inspection capability or event logging of certificate subjects; if unavailable, monitor client-side TLS validation errors being suppressed.
Splunk SPL Query
index=network sourcetype=stream:tls
| search dest_port=443
| spath input=certificate.subject path=CN output=cn
| spath input=certificate.san path=*.dNSName output=san
| eval cert_pattern = coalesce(cn, san)
| where match(cert_pattern, "\.\*\.")
| stats count by src_ip, dest_ip, cert_pattern, _time
| where count > 10
| table _time, src_ip, dest_ip, cert_pattern, count
Wazuh OSSEC Rule
<group name="mongoose-tls,">
<rule id="100732" level="8">
<if_sid>100001</if_sid>
<match>mg_tls_verify_cert_san|mg_tls_verify_cert_cn|wildcard|certificate verify failed</match>
<description>Possible CVE-2026-73253: Mongoose TLS hostname verification bypass pattern detected in logs.</description>
<group>tls,mitm,</group>
<mitre>
<id>T1557</id>
</mitre>
</rule>
</group>
Mitigation & Patch Guidance
Patch Confidence: 2/4 — CLAIMED. The only patch reference is from OSV, indicating a fix in version 7.22. This has not been independently verified by a second authoritative source (e.g., a vendor advisory or GitHub commit). Until verified, treat the fix as provisional and verify the upgrade addresses the exact mg_match() wildcard-boundary flaw.
Immediate Mitigations (until patch applied):
- Disable built-in TLS: Configure Mongoose to use an external TLS library (OpenSSL, mbedTLS, wolfSSL) instead of
src/tls_builtin.c— these libraries implement RFC 6125-compliant wildcard matching. - Restrict network exposure: Segment Mongoose client devices from untrusted networks — specifically deny them direct access to the internet or to networks with untrusted infrastructure (e.g., untrusted Wi-Fi, public networks).
- Deploy mutual TLS (mTLS): Where possible, configure client-side certificate authentication so that the server must present its own client certificate — this prevents the wildcard-certificate attack from succeeding even if hostname verification fails.
- Pin leaf certificates: In applications controlling the client CA store, pin the exact leaf certificate or the exact expected hostname-public-key binding, bypassing dependence on wildcard matching.
Patch/Upgrade Steps:
- Verify the current Mongoose version (
mg_version()or build constants). - If < 7.22, update to v7.22 or later from the official Cesanta repository (https://github.com/cesanta/mongoose).
- Independently confirm the patch — review the diff for
src/tls_builtin.cand confirmmg_match()is no longer used directly for SAN/CN hostname checking or that a label-boundary-aware wildcard match (e.g.,mg_match_uriwith stricter rules) is used. - After upgrading, run a regression test with a wildcard certificate for a deeper subdomain (e.g.,
*.example.comagainstfoo.bar.example.com) to verify the connection is rejected.
Long-Term Hardening:
- Standardize on external TLS libraries (OpenSSL/mbedTLS) for production deployments — they receive independent security review of their certificate validation.
- Implement a certificate monitoring policy: alert on wildcard certificates used for multi-label subdomains in your own infrastructure.
- Review embedded device firmware update processes to ensure TLS endpoints are properly validated before firmware is accepted.
- Subscribe to OSV and NVD feeds for Mongoose to catch future advisories quickly.
Workarounds from vendor: N/A — no vendor-supplied workaround exists independent of the patch.
References
- NVD Entry for CVE-2026-73253 — https://nvd.nist.gov/vuln/detail/CVE-2026-73253
- OSV Advisory for CVE-2026-73253 (patch source, fixed in v7.22) — https://osv.dev/vulnerability/CVE-2026-73253
- Mongoose Official Repository — https://github.com/cesanta/mongoose (reference for version 7.22 fix)
- RFC 6125 — Representation and Verification of Domain-Based Application Service Identity within PKI (wildcard certificate rules) — https://datatracker.ietf.org/doc/html/rfc6125
- CWE-295 — Improper Certificate Validation — https://cwe.mitre.org/data/definitions/295.html
Threat Actor Activity / Exploit-in-the-Wild: No known threat actor campaigns have adopted CVE-2026-73253, and no exploit code or PoC has been publicly released. CISA KEV does not list this vulnerability. The attack requires substantial preconditions (valid wildcard certificate + on-path position), making indiscriminate exploitation unlikely; targeted espionage against embedded deployments is the most credible threat scenario.
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.