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-P64J-F4X9-WQ66

GHSA-P64J-F4X9-WQ66: OAuth Redirect URI Path Truncation in Ech0 Leads to Authorization Code Theft

Alon Barad
Alon Barad
Software Engineer

May 7, 2026·6 min read·23 visits

Executive Summary (TL;DR)

Improper validation of OAuth redirect URIs in Ech0 allows attackers to append malicious paths to trusted domains. Exploitation leads to the theft of authorization exchange codes and full account takeover.

The Ech0 lightweight publishing platform contains a critical vulnerability in its OAuth 2.0 implementation where redirect URI validation ignores the path component. This oversight permits attackers to route authenticated victims to malicious endpoints on trusted domains, resulting in the theft of authorization codes and subsequent account takeover.

Vulnerability Overview

Ech0 is a self-hosted lightweight publishing platform utilizing OAuth 2.0 for user authentication and authorization. The platform relies on an administrator-defined allowlist to restrict authorized callback endpoints during the OAuth flow. This mechanism restricts malicious actors from redirecting authenticated users to untrusted destinations and stealing their session tokens.

A vulnerability identified as GHSA-P64J-F4X9-WQ66 exists within the parseAndValidateClientRedirect function of the authentication service. The validation logic improperly verifies the redirect_uri parameter by only checking the scheme and host components of the requested URL. The implementation completely ignores the path, query, and fragment components during the validation sequence.

This flaw violates RFC 6749 §3.1.2, which mandates exact string matching for redirection endpoints to maintain security boundaries. The vulnerability allows an attacker to supply a crafted redirect_uri targeting a malicious path or open redirect on a trusted domain. Successful exploitation leads to the exposure of one-time authorization codes, enabling full account takeover.

Root Cause Analysis

The root cause resides in the custom URL parsing and validation logic implemented within internal/service/auth/auth.go. When an OAuth flow initiates, the application extracts the redirect_uri parameter and compares it against an array of permitted URLs defined in the application configuration. The developers implemented a partial comparison strategy instead of an exact string match.

The logic extracts the Scheme and Host properties from the parsed URL object and uses strings.EqualFold to perform a case-insensitive comparison against the permitted URL. If both components match, the function sets a boolean flag to true, approving the redirection attempt. The code drops the Path, RawQuery, and Fragment properties during this evaluation.

This structural oversight creates a significant security gap when the whitelisted domain hosts unauthenticated user-generated content, open redirects, or third-party analytical scripts. An attacker constructs a URI containing a trusted domain and an untrusted path, satisfying the validation constraints while directing the final application flow to a hostile endpoint.

Code Analysis

An examination of the pre-patch source code reveals the precise nature of the logical flaw in the validation routine. The original implementation relied solely on scheme and host comparisons without analyzing the remaining URI segments.

// Pre-patch implementation in internal/service/auth/auth.go
if strings.EqualFold(redirectURL.Scheme, allowURL.Scheme) &&
   strings.EqualFold(redirectURL.Host, allowURL.Host) {
    matched = true
}

The patch introduced in commit a7e8b8e84bd1e3db090dfb720f2c6c433356b442 addresses this oversight by constructing normalized strings that incorporate the path component. The updated logic concatenates the lowercased scheme, host, and case-sensitive path before performing an exact string comparison.

// Post-patch implementation
redirectNorm := strings.ToLower(redirectURL.Scheme) + "://" +
    strings.ToLower(redirectURL.Host) + redirectURL.Path
allowNorm := strings.ToLower(allowURL.Scheme) + "://" +
    strings.ToLower(allowURL.Host) + allowURL.Path
 
if redirectNorm == allowNorm {
    matched = true
}

The developers also refactored the BindOAuth and GetOAuthLoginURL functions to enforce early validation. The patched application now verifies the requested redirection URI before generating and signing the state JWT. This structural change prevents the application from minting cryptographic tokens containing malicious payload data, eliminating the core exploitation primitive.

Exploitation Methodology

Exploitation of this vulnerability requires the attacker to construct a crafted OAuth authorization link and deliver it to a target user. The attacker sets the redirect_uri parameter to a hostile path on a permitted domain, such as an open redirect endpoint or a page containing third-party tracking scripts.

When the victim initiates the OAuth flow, the Ech0 server validates the truncated URI, generates a signed state JSON Web Token containing the complete malicious URI, and forwards the victim to the Identity Provider. After successful authentication, the Identity Provider redirects the victim back to the Ech0 callback endpoint, appending an authorization code and the unaltered state parameter.

The Ech0 server receives the callback, decodes the state token, and trusts the embedded redirect_uri because it carries a valid cryptographic signature generated by the server. The application then issues an HTTP 302 redirection, sending the victim and their authorization code to the attacker-controlled path. The attacker subsequently extracts the code via Referer header leakage or by capturing traffic from an open redirect chain.

Impact Assessment

The primary impact of this vulnerability is complete account takeover through authorization code theft. The stolen code allows the attacker to finalize the OAuth flow independently, binding their session to the victim's identity within the Ech0 platform.

An attacker exploiting this flaw gains unauthorized access to all application functions available to the compromised user. For a lightweight publishing platform, this access permits the unauthorized publication of articles, modification of existing content, and extraction of private data. If the victim holds administrative privileges, the attacker achieves total control over the platform.

The attack relies on specific environmental prerequisites to succeed. The attacker must identify an exploitable path on the trusted domain, and the victim must interact with the crafted link while holding an active session with the Identity Provider. Despite these constraints, the vulnerability presents a severe risk due to the complete circumvention of the application's authentication boundary.

Remediation and Mitigation

The primary remediation strategy requires updating the Ech0 application to a version containing commit a7e8b8e84bd1e3db090dfb720f2c6c433356b442. Administrators must ensure the deployment utilizes the latest upstream code repository to mitigate the vulnerability effectively.

Application administrators should conduct a comprehensive audit of the Auth.Redirect.AllowedReturnURLs configuration setting. The whitelist must exclusively contain explicit, trusted endpoints necessary for operational requirements. Removing domains that host user-generated content or unauthenticated redirectors reduces the attack surface significantly.

Security teams can implement Web Application Firewall rules to detect and block incoming OAuth requests containing unexpected paths in the redirect_uri parameter. Furthermore, administrators should monitor server access logs for anomalous callback URIs, specifically searching for anomalies in the state parameter processing during authentication events.

Fix Analysis (1)

Technical Appendix

CVSS Score
8.1/ 10

Affected Systems

Ech0 open-source publishing platform

Affected Versions Detail

Product
Affected Versions
Fixed Version
Ech0
lin-snow
< a7e8b8e84bd1e3db090dfb720f2c6c433356b442a7e8b8e84bd1e3db090dfb720f2c6c433356b442
AttributeDetail
CWE IDCWE-601
Attack VectorNetwork
CVSS Score8.1 (High)
ImpactAccount Takeover via Code Theft
Exploit StatusProof of Concept
Authentication RequiredNone

MITRE ATT&CK Mapping

T1550.001Use Alternate Authentication Material: Application Access Token
Defense Evasion
T1566Phishing
Initial Access
CWE-601
URL Redirection to Untrusted Site ('Open Redirect')

Improper validation of URL components enables attackers to redirect users to malicious paths on trusted domains.

Known Exploits & Detection

GitHub AdvisoryExploitation steps detailing URI poisoning and referer leakage.

Vulnerability Timeline

Patch Committed
2026-05-03

References & Sources

  • [1]GitHub Security Advisory: GHSA-P64J-F4X9-WQ66
  • [2]Ech0 Patch Commit a7e8b8e84bd
  • [3]Ech0 GitHub Repository
  • [4]RFC 6749 Section 3.1.2

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

•20 minutes ago•CVE-2026-63376
8.2

CVE-2026-63376: Prototype Pollution via Path Desynchronization in toml-node

A prototype pollution vulnerability exists in the toml-node library (by BinaryMuse) in versions prior to 4.1.2. The flaw arises from inconsistent internal tracking of parsed paths (comma-joined vs. dot-joined serialization) combined with lack of object ownership validation during recursive dictionary descent (scalar descent). This allows unauthenticated remote attackers to modify base object structures by crafting malicious TOML documents containing conflicting duplicate table paths or nested references.

Alon Barad
Alon Barad
0 views•6 min read
•about 1 hour ago•CVE-2026-69083
10.0

CVE-2026-69083: Unauthenticated SQL Injection and SQL Command Execution in SiYuan Full-Text Search API

An unauthenticated SQL injection and SQL execution vulnerability in SiYuan allows remote attackers to compromise the integrity and confidentiality of the asset database. The flaw exists due to string concatenation in regular expression searches and a complete lack of authorization checks on raw SQL querying pathways under default configurations. Attackers can leverage this vulnerability to exfiltrate database contents, manipulate index records, or access cross-notebook contents without any valid credentials.

Alon Barad
Alon Barad
3 views•6 min read
•about 2 hours ago•CVE-2026-68587
9.2

CVE-2026-68587: Broken Access Control in SiYuan Note Transaction Endpoints

CVE-2026-68587 is a critical authorization bypass vulnerability in SiYuan, an open-source personal knowledge management workspace. When deployed in publish mode, specific transaction endpoints fail to perform administrative role validation. This omission enables unauthenticated remote readers to retrieve the rendered Document Object Model (DOM) of publish-disabled (private) documents by supplying a target heading block identifier. Upgrading to version v3.7.3 or later resolves this issue by applying appropriate routing middleware constraints.

Amit Schendel
Amit Schendel
5 views•6 min read
•about 3 hours ago•CVE-2026-68586
9.2

CVE-2026-68586: Missing Authorization in SiYuan Backlink Content Endpoints Allows Information Disclosure

SiYuan is a privacy-first personal knowledge management system. In versions prior to v3.7.3, the application fails to apply publish-access filters to the getBacklinkDoc and getBackmentionDoc content endpoints (/api/ref/getBacklinkDoc and /api/ref/getBackmentionDoc). While the corresponding backlink list endpoints correctly filter out publish-forbidden documents, the content endpoints, which are only gated by high-level route authorization checks via CheckAuth, do not. Consequently, a user with low-privilege read access, or an anonymous reader when publish Basic Auth is disabled, can directly invoke these endpoints using a known publish-forbidden document's ID to retrieve its rendered DOM content or determine whether it references a specific target block.

Amit Schendel
Amit Schendel
3 views•7 min read
•about 4 hours ago•CVE-2026-68585
5.8

CVE-2026-68585: Metadata Disclosure via Missing Authorization in SiYuan API

A metadata disclosure vulnerability exists in SiYuan prior to version v3.7.3. The /api/block/getBlockInfo endpoint fails to validate authorization boundaries in publish mode, allowing anonymous readers to access private document metadata.

Alon Barad
Alon Barad
6 views•8 min read
•about 5 hours ago•CVE-2026-72812
6.5

CVE-2026-72812: Broken Access Control and SQL Injection in SiYuan

A critical authorization bypass vulnerability exists in SiYuan personal knowledge management system before v3.7.4. The /api/ref/refreshBacklink endpoint lacks administrative role verification, enabling unauthenticated users to initiate database transactions and disk operations. When combined with an unsafe SQL generation pattern in nested backlink queries, an attacker can exploit a secondary SQL injection vulnerability to compromise local databases or cause denial-of-service conditions.

Amit Schendel
Amit Schendel
4 views•6 min read