CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-4PH6-MJV7-3FQ6

GHSA-4PH6-MJV7-3FQ6: Improper Handling of Untrusted DNS-over-HTTPS Response Data in netfoil

Alon Barad
Alon Barad
Software Engineer

Aug 24, 2026·6 min read·30 visits

Executive Summary (TL;DR)

Unvalidated ALPN parsing in netfoil permits terminal log injection and memory exhaustion.

netfoil, an allowlist-based DNS proxy, failed to sanitize ALPN fields parsed from untrusted DNS-over-HTTPS (DoH) HTTPS Resource Records. This allowed attackers to inject ANSI escape sequences into log files or trigger Denial of Service (DoS) via uncontrolled memory allocations.

Vulnerability Overview

netfoil is a client-side, minimal DNS proxy built in Go that relies on DNS-over-HTTPS (DoH) to secure upstream queries and apply allowlists.

During standard resolution operations, the proxy parses incoming DNS resource records, including HTTPS Resource Records (RR) defined by RFC 9460. These records contain Application-Layer Protocol Negotiation (ALPN) parameters used to negotiate client-server protocol capabilities.

Prior to version v0.5.0, netfoil did not validate or sanitize the parsed ALPN parameters. Any raw byte sequence returned in the ALPN field by an upstream server was converted directly into Go strings and subsequently logged or stored.

This lack of validation exposed the proxy to log poisoning via ANSI escape sequence injection and denial of service via memory exhaustion. In addition, the system lacked structured logging for single-byte DNS response codes (RCODE), logging raw numbers directly to standard output.

Root Cause Analysis

The vulnerability is situated within the parsing function readALPN in internal/dns/dns_https.go. This function processes raw byte slices containing ALPN identifiers.

RFC 9460 defines the ALPN parameter in HTTPS records as a list of length-prefixed protocol identifiers. The unpatched readALPN implementation sequentially read each identifier via a helper function readPart and converted the raw bytes directly to a Go string.

No checks were performed to verify if the converted strings matched legitimate ALPN values, nor were there limitations on the number of unique or repetitive strings parsed.

An attacker capable of manipulating the upstream DNS response could inject non-printable characters, terminal escape sequences, or millions of duplicate keys. The proxy would attempt to process and store all incoming values, causing excessive memory allocations and terminal-side command execution through output manipulation.

Code Analysis & Patch Review

Below is the comparison of the vulnerable implementation versus the patched implementation in internal/dns/dns_https.go.

// VULNERABLE: internal/dns/dns_https.go
func readALPN(data []byte) ([]string, error) {
	p := bytes.NewBuffer(data)
	parts := make([]string, 0)
 
	for {
		if p.Len() == 0 {
			break
		}
		part, err := readPart(p)
		if err != nil {
			return nil, err
		}
		parts = append(parts, string(part)) // Direct unvalidated conversion
	}
 
	return parts, nil
}

The patch introduced strict allowlist matching and a uniqueness check using a map-based set to control memory footprint.

// PATCHED: internal/dns/dns_https.go
func readALPN(data []byte) ([]string, error) {
	p := bytes.NewBuffer(data)
	alpnSet := make(map[string]struct{})
	result := make([]string, 0)
	for {
		if p.Len() == 0 {
			break
		}
		part, err := readPart(p)
		if err != nil {
			return nil, err
		}
 
		alpn := string(part)
		switch alpn {
		case "h2":
			_, found := alpnSet[alpn]
			if !found {
				result = append(result, alpn)
				alpnSet[alpn] = struct{}{}
			}
		case "h3":
			_, found := alpnSet[alpn]
			if !found {
				result = append(result, alpn)
				alpnSet[alpn] = struct{}{}
			}
		default:
			// Safe fallback: silently drop unapproved values
		}
	}
 
	return result, nil
}

The fix successfully mitigates both log injection and resource consumption. By explicitly restricting valid ALPN tokens to a static switch case ("h2" and "h3"), all arbitrary string conversions are eliminated. The use of alpnSet enforces a maximum slice capacity of two elements, blocking the duplicate exhaustion vector completely.

Exploitation & Proof-of-Concept Analysis

Exploitation of this vulnerability requires the attacker to control the DNS resolution path of the client using netfoil.

This can be achieved by hijacking an upstream DoH resolver, poisoning the cache of an intermediate resolver, or setting up a malicious authoritative nameserver for a domain queried by the target client.

To perform terminal escape sequence injection, the attacker crafts an HTTPS resource record where the ALPN field contains ANSI escape codes such as \x1b[2J\x1b[H (Clear Screen) or sequences designed to manipulate terminal scrollback and inject arbitrary output lines.

When the proxy resolves the target domain, the raw escape sequences are parsed and written directly to standard output by the logging routine. If the administrator views the logs in an active terminal emulator, the emulator processes the escape sequence, executing the actions locally.

For a Denial of Service attack, the attacker crafts an HTTPS resource record containing a long loop of identical or unique fake ALPN entries. The unpatched proxy continually allocates new memory for the parts slice until the host system encounters an Out of Memory (OOM) condition and kills the process.

Impact Assessment

The primary impact of this vulnerability is local denial of service and log manipulation.

Because netfoil acts as an allowlist-based DNS proxy, terminating the process disrupts local resolution entirely or bypasses security policies if fallback mechanisms are configured to permit unproxied traffic.

Log poisoning through ANSI injection presents a moderate threat to administrative integrity. It can hide security warnings, falsify system status messages, or spoof user interactions in active terminals.

This vulnerability has been assigned a CVSS score of 6.5 (Medium), reflecting the high requirement of network position or upstream control, coupled with the potential for host-level availability loss and log tampering.

Remediation & Mitigation Guidance

Remediation requires updating the netfoil package to version v0.5.0 or later.

To update the dependency in a Go project, execute the following command:

go get -u github.com/tinfoil-factory/netfoil@v0.5.0

If upgrading immediately is not feasible, administrators should enforce the use of trustworthy, verified upstream DoH resolvers (such as Cloudflare or Google DNS) that filter out malformed or suspicious resource records prior to delivery.

Additionally, standard output streams from netfoil can be sanitized through log forwarding utilities to strip control characters before they reach interactive terminal sessions.

For example, administrators can pipe log outputs through a sanitization utility:

./netfoil | tr -cd '\11\12\15\40-\176'

Official Patches

tinfoil-factoryRelease v0.5.0

Fix Analysis (2)

Technical Appendix

CVSS Score
6.5/ 10
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:H

Affected Systems

netfoil DNS Proxy

Affected Versions Detail

Product
Affected Versions
Fixed Version
netfoil
tinfoil-factory
< v0.5.0v0.5.0
AttributeDetail
CWE IDCWE-117, CWE-20, CWE-400
Attack VectorNetwork (DNS Response Control Required)
CVSS v3.1 Score6.5
ImpactDenial of Service, Log Manipulation
Exploit StatusNone
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1562.006Impair Defenses: Indicator Blocking
Defense Evasion
T1059Command and Scripting Interpreter
Execution
CWE-117
Improper Output Neutralization for Logs

The software does not neutralize or incorrectly neutralizes output written to logs, allowing malicious input to alter log structures or run terminal-side payload sequences.

Vulnerability Timeline

Parsed ALPN sanitization patch completed and committed (Commit 817f664)
2026-06-12
RCODE formatting patch completed and committed (Commit 58cfb0c)
2026-06-12
netfoil Release v0.5.0 published
2026-06-12
GitHub Security Advisory GHSA-4PH6-MJV7-3FQ6 formally published
2026-06-12

References & Sources

  • [1]GHSA-4PH6-MJV7-3FQ6 Advisory Page
  • [2]netfoil Source Code Repository

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 1 hour ago•GHSA-R48V-R4VW-H9V8
5.5

GHSA-r48v-r4vw-h9v8: Arbitrary Build-Host File Disclosure via Path Traversal in Hugo Vendored Module Metadata

Hugo versions prior to 0.170.0 contain a path traversal and improper symlink resolution vulnerability in the module resolution and vendoring subsystem. By supplying relative traversal sequences in `_vendor/modules.txt` or crafting symbolic links within vendored directory hierarchies, an untrusted third-party theme or Hugo module can bind its module root to an arbitrary directory on the build host. During site compilation, template functions such as `readFile` can access and render sensitive files from the host filesystem into the generated static output.

Alon Barad
Alon Barad
3 views•9 min read
•about 2 hours ago•GHSA-4WHP-JX7J-XVRM
5.1

GHSA-4whp-jx7j-xvrm: Stored Cross-Site Scripting in Hugo Syntax Highlighter via wrapperClass

A stored Cross-Site Scripting (XSS) vulnerability in the Hugo static site generator (versions 0.140.2 prior to 0.170.0) allows content authors to inject arbitrary HTML and JavaScript into generated pages. The flaw resides in the syntax highlighting component (`markup/highlight/highlight.go`), where the `wrapperClass` option is concatenated directly into an HTML `<div class="...">` attribute without HTML entity escaping. Because shortcodes and code fence attributes bypass Goldmark's raw HTML sanitization rules, untrusted contributors in multi-author workflows can achieve client-side script execution in the browsers of site visitors.

Alon Barad
Alon Barad
2 views•9 min read
•about 4 hours ago•CVE-2026-139994
4.7

CVE-2026-139994: Cross-Site Scripting via Context-Mismatched HTML Escaping in React Router RSC Streaming Redirects

CVE-2026-139994 (GHSA-mjj8-rxh9-q8f5) is a Cross-Site Scripting (XSS) vulnerability in React Router affecting versions 7.11.0 through 7.18.3 and 8.0.0 through 8.3.1. The flaw resides in the server-side streaming handler for the unstable React Server Components (RSC) Data mode and RSC Framework mode. When a server-side redirect is triggered during an HTML stream, the framework injects an inline <meta http-equiv="refresh"> element into the response stream. Because the redirect destination URL is sanitized using an HTML body escaping utility (escapeHtml) rather than an attribute-specific encoding function, double-quote characters (") are left unescaped. An attacker who can influence the redirect URL can break out of the content attribute context, inject arbitrary attributes or HTML elements, and execute arbitrary JavaScript within the victim's browser session.

Alon Barad
Alon Barad
5 views•11 min read
•about 5 hours ago•CVE-2026-139996
7.4

CVE-2026-139996: Prototype Pollution in React Router via Vendored turbo-stream Deserializer

CVE-2026-139996 is a prototype pollution vulnerability (CWE-1321) in React Router's vendored turbo-stream deserializer, utilized in Framework mode for single-fetch transitions and client-server hydration. When unflattening serialized streams, the decoder assigns object properties using direct bracket notation (object[key] = value) rather than defining own properties via Object.defineProperty. Furthermore, the deserializer lacks integer and bounds validation on stream reference indices. An attacker capable of supplying crafted turbo-stream payloads to the deserializer can pollute Object.prototype or trigger arbitrary index dereferences, compromising application integrity and confidentiality.

Amit Schendel
Amit Schendel
4 views•9 min read
•about 6 hours ago•CVE-2026-137181
7.1

CVE-2026-137181: Incorrect Authorization via Improper Context Cancellation Propagation in OpenFGA

CVE-2026-137181 (GHSA-637h-v79h-mvqf) is an incorrect authorization vulnerability (CWE-863) in OpenFGA versions 1.10.3 through 1.22.x. The graph evaluation engine fails to distinguish between normal stream exhaustion and context cancellations or deadline exceedances during concurrent set evaluations. When resolving models using relational set operations (and, or, but not), an aborted worker branch can be evaluated as empty rather than errored, causing the engine to return unauthorized access grants (Allowed: true). When query caching is enabled, these erroneous evaluation states can be persisted to the in-memory cache, poisoning subsequent authorization checks.

Amit Schendel
Amit Schendel
4 views•9 min read
•about 7 hours ago•CVE-2026-137200
7.5

CVE-2026-137200: Denial of Service via Unhandled Upgrade Error in Engine.IO

An uncaught exception vulnerability (CWE-248) in Engine.IO versions prior to 6.6.12 allows remote unauthenticated attackers to cause a Denial of Service (DoS) against Node.js applications utilizing Engine.IO or Socket.IO. By sending an HTTP upgrade request targeting a non-Engine.IO URL path and forcibly resetting the underlying TCP connection before the internal destruction timeout expires, an attacker triggers an unhandled ECONNRESET error event on the socket object, terminating the entire Node.js runtime process.

Alon Barad
Alon Barad
6 views•10 min read