Aug 28, 2026·6 min read·84 visits
A timing side-channel in Phalcon allows remote, unauthenticated attackers to forge encrypted payloads by guessing HMAC signatures byte-by-byte.
Phalcon versions prior to 5.14.1 are vulnerable to a timing side-channel attack in the authenticated decryption process. The HMAC signature verification utilizes a non-constant-time byte comparison, allowing unauthenticated remote attackers to reconstruct valid signatures and forge arbitrary encrypted payloads.
The Phalcon PHP framework, distributed as a high-performance C extension, provides cryptographic capabilities through its Phalcon\Encryption\Crypt component. When message signing is enabled, this component is designed to follow an Encrypt-then-MAC paradigm to guarantee the integrity and authenticity of encrypted data before decryption.
Prior to version 5.14.1, the implementation of the signature verification process introduced a critical security flaw. The framework used a standard, non-constant-time byte-wise comparison operator to validate the Hash-based Message Authentication Code (HMAC) of incoming payloads.
This behavior exposes an observable timing side-channel, classified as CWE-208. An unauthenticated remote attacker can exploit this discrepancy to bypass signature checks and subsequently perform payload forgery, leading to unauthorized data manipulation or privilege escalation depending on how the application processes decrypted data.
The root cause of CVE-2026-54736 resides in the Zephir source code of the Crypt::decrypt() method. Zephir is a high-level language compiled into native C code to produce PHP extensions. The vulnerable version of Phalcon performed the HMAC comparison using the strict inequality comparison operator !==.
During compilation from Zephir to native C, the inequality comparison operator for string values is lowered to the ZEPHIR_IS_IDENTICAL macro. For equal-length string arguments, this macro invokes the standard library function memcmp. Because memcmp is optimized for execution speed, it terminates and returns as soon as it encounters the first non-matching byte between the two compared memory blocks.
This early-termination behavior creates an execution path whose duration is directly proportional to the number of matching prefix bytes in the compared hashes. By measuring the precise network latency of decryption requests, a remote attacker can discern whether their guess for a specific byte position was correct. This timing leak breaks the cryptographic security guarantees of the signature check.
An analysis of the vulnerable source code in phalcon/Encryption/Crypt.zep reveals two significant flaws. First, the comparison uses the non-constant-time operator. Second, the decryption pipeline performs plaintext unpadding before verifying the signature, which violates the standard Encrypt-then-MAC workflow.
// VULNERABLE CODE PATH
let decrypted = this->decryptGcmCcmAuth(mode, cipherText, decryptKey, iv);
let padded = decrypted;
// Unpadding occurs before verifying the integrity signature
let decrypted = this->decryptGetUnpadded(mode, blockSize, decrypted);
if true === this->useSigning {
// Strict inequality comparison lowers to non-constant-time memcmp
if digest !== hash_hmac(hashAlgorithm, padded, decryptKey, true) {
throw new Mismatch("Hash does not match.");
}
}The official patch in commit ad53ab1b2e7ec59b3af92b0b37b8aaa099011137 reorganizes the processing order and introduces constant-time validation. By using hash_equals(), which maps to a constant-time comparison helper, the framework ensures that execution latency remains independent of the input values.
// PATCHED CODE PATH
if true === this->useSigning {
// Verification now uses constant-time hash_equals against the padded data
if true !== hash_equals(hash_hmac(hashAlgorithm, decrypted, decryptKey, true), digest) {
throw new Mismatch("Hash does not match.");
}
}
// Unpadding is deferred until after successful signature verification
return this->decryptGetUnpadded(
mode,
blockSize,
decrypted
);Exploiting this timing side-channel requires high-precision latency profiling over a network interface. Because the execution variance introduced by memcmp is on the order of nanoseconds or microseconds, the attacker must mitigate network jitter by collecting multiple timing samples for each candidate byte value.
The attack begins with a baseline assessment where the attacker supplies an arbitrary ciphertext and a random HMAC tag. The attacker then iterates through all possible byte values (0x00 to 0xFF) for the first byte of the signature. By analyzing the statistical distribution of response times, the attacker identifies the single candidate value that produces a statistically significant increase in execution time, indicating that the comparison reached the second byte.
Once the first byte is determined, the attacker fixes its value and repeats the procedure for the second byte. This process is repeated sequentially for each byte of the signature. After reconstructing the valid HMAC tag for a manipulated ciphertext, the attacker can submit the forged payload, which the application will accept as authentic, bypassing all integrity controls.
The impact of CVE-2026-54736 is critical because it compromises the core security guarantees of Phalcon's encryption wrapper. When applications rely on Crypt::decrypt() to process sensitive data, such as session cookies, password reset tokens, or stateful identifiers, the ability to forge valid signatures allows for comprehensive integrity violation.
Depending on the application logic, payload forgery can lead to privilege escalation, session hijacking, or arbitrary state manipulation. For example, if an application stores serialized user sessions inside an encrypted cookie, an attacker who successfully recovers the HMAC signature can modify the session properties to gain administrator access.
Although the attack complexity is rated as High due to the statistical profiling required to overcome network noise, the impact is severe because it requires no prior authentication or administrative privileges. This vulnerability is assigned a CVSS v4.0 base score of 8.2, reflecting the critical integrity compromise without direct confidentiality leak from the channel itself.
The primary remediation path is upgrading the Phalcon framework extension and its associated PHP library dependencies to version 5.14.1 or higher. This release integrates the constant-time hash_equals verification mechanism and enforces correct Encrypt-then-MAC order of operations.
For environments where immediate system upgrades are not feasible, network-level mitigations must be implemented. Security teams should deploy Web Application Firewall (WAF) rules or rate-limiting policies that restrict the volume of consecutive, failing requests to endpoints utilizing the decryption routine. Because the attack relies on thousands of precise requests to isolate each byte, aggressive rate limits will disrupt the profiling phase.
Additionally, developers should audit their codebases to ensure that they do not expose detailed cryptographic error messages to the client. Detailed exceptions, such as 'Hash does not match' versus general application errors, should be caught internally and logged, returning only generic status codes to external users.
CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N| Product | Affected Versions | Fixed Version |
|---|---|---|
cphalcon Phalcon | < 5.14.1 | 5.14.1 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-208 |
| Attack Vector | Network |
| CVSS v4.0 | 8.2 (High) |
| Exploit Status | Proof-of-Concept |
| KEV Status | Not Listed |
The product uses a non-constant-time algorithm to compare sensitive cryptographic secrets, allowing attackers to infer the value of the secret through timing analysis.
CVE-2026-126295 (also tracked as GHSA-fg9w-wfp5-j933) is a path confinement bypass vulnerability in the Natural Language Toolkit (NLTK) affecting versions 3.10.0 prior to 3.10.4. The flaw resides in nltk/parse/bllip.py within the BllipParser class and its factory method BllipParser.from_unified_model_dir(). Unlike sibling tool wrappers in NLTK that enforce data-root confinement via the nltk.pathsec module, BllipParser passes caller-supplied filesystem paths directly into the third-party bllipparser native C extension without validation. When an application passes untrusted input as model paths or directories to BllipParser, an attacker can force the native extension to open arbitrary files on the local filesystem. This leads to information disclosure through parser diagnostic oracles, local model tampering via shared directories, and denial of service by hanging worker threads on blocking special files (such as FIFOs or device nodes) or exhausting memory via oversized files.
CVE-2026-126300 (GHSA-ffr9-mgrr-wcvr) is an inefficient algorithmic complexity vulnerability (CWE-407) in the Natural Language Toolkit (NLTK) Python library affecting versions 3.2.5 prior to 3.10.4. The flaw resides in the quote-restoration routine of TreebankWordTokenizer.span_tokenize and NLTKWordTokenizer.span_tokenize, where repeated calls to list.pop(0) over matched quote tokens introduce quadratic O(n^2) time complexity. An unauthenticated remote attacker who supplies input containing long sequences of double-quote characters can exhaust CPU resources and degrade service availability.
The Natural Language Toolkit (NLTK) versions 3.6 through 3.10.3 contain an algorithmic complexity vulnerability in the LegalitySyllableTokenizer.tokenize method. When processing tokens composed of continuous runs of vowels, an unguarded string reversal and set membership lookup loop executes in quadratic time relative to the input token length. Remote attackers capable of submitting arbitrary text to applications utilizing this tokenizer can trigger sustained single-core CPU exhaustion and application-level denial of service.
CVE-2026-126304 is a symlink path traversal vulnerability (CWE-59) in the Natural Language Toolkit (NLTK) versions 3.10.0 prior to 3.10.4. The YCOECorpusReader class constructs internal sub-readers for the 'psd' and 'pos' subdirectories using FileSystemPathPointer.join(), which relies exclusively on lexical string-prefix validation rather than canonical path resolution. An attacker who supplies a crafted YCOE corpus containing symbolic links in place of the 'psd' or 'pos' subdirectories can bypass directory confinement and read arbitrary files from sibling corpora or sensitive directories within the NLTK data sandbox.
CVE-2026-128077 (GHSA-r99w-jh2x-3mg9) is an authorization bypass and interpretation conflict vulnerability affecting Nuxt and its underlying @nuxt/nitro-server package in versions 4.6.0 through 4.6.3. When an incoming HTTP request path begins with a double forward slash (e.g., //x/admin), the WHATWG URL parser within the Nuxt server-side page renderer interprets the initial segment as a network host/authority and resolves the remaining path (/admin) against the application's page router. Because Nitro server middleware, route-scoped serverHandlers, and Nitro routeRules evaluate the unparsed request path (//x/admin), path-based access controls, redirects, and security header policies configured for /admin fail to match and are bypassed.
Prior to version 2.10.2, the sqlite3-ruby gem explicitly cast 64-bit Ruby string lengths (long) to 32-bit signed integers (int) when invoking the underlying SQLite C API. On 64-bit platforms, providing a string of 4 GiB (2^32 bytes) or larger causes integer truncation, instructing SQLite to process only a prefix of the string. This flaw affects SQL query preparation, bound parameter values, and return values from custom Ruby-defined SQL functions and aggregates, allowing trailing SQL clauses such as WHERE restrictions to be silently dropped under specific conditions.