# CVE-2026-40194: phpseclib has a variable-time HMAC comparison in SSH2::get_binary_packet() using != instead of hash_equals()

- Severity: Low 3.7 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.38%, higher than 33% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-04-10T20:24:06.696Z
- Modified: 2026-09-10T03:51:02.985Z
- Also known as: GHSA-r854-jrxh-36qx
- Weaknesses: CWE-208
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

phpseclib is a PHP secure communications library. Starting in 0.1.1 and prior to 3.0.51, 2.0.53, and 1.0.28, phpseclib\Net\SSH2::get_binary_packet() uses PHP's != operator to compare a received SSH packet HMAC against the locally computed HMAC. != on equal-length binary strings in PHP uses memcmp(), which short-circuits on the first differing byte. This is a real variable-time comparison (CWE-208), proven by scaling benchmarks. This vulnerability is fixed in 3.0.51, 2.0.53, and 1.0.28.

(As written by CVE List.)

## Affected

- phpseclib phpseclib: >= 0.1.1, < 1.0.28; >= 2.0.0, < 2.0.53; >= 3.0.0, < 3.0.51; up to 1.0.27; from 2.0.0 before 2.0.53; from 3.0.0 before 3.0.51
- phpseclib/phpseclib (Packagist): from 0.1.1 before 1.0.28; from 2.0.0 before 2.0.53; from 3.0.0 before 3.0.51

## Every score

- GitHub_M: CVSS:3.1 3.7 Low `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N`
- GitHub: CVSS:3.1 3.7 Low `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N`

## References

- <https://github.com/phpseclib/phpseclib/security/advisories/GHSA-r854-jrxh-36qx> (exploit, vendor-advisory, web)
- <https://github.com/phpseclib/phpseclib/commit/ffe48b6b1b1af6963327f0a5330e3aa004a194ac> (patch, web)
- <https://github.com/phpseclib/phpseclib/releases/tag/1.0.28> (release-notes, web)
- <https://github.com/phpseclib/phpseclib/releases/tag/2.0.53> (release-notes, web)
- <https://github.com/phpseclib/phpseclib/releases/tag/3.0.51> (release-notes, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-40194> (advisory)
- <https://github.com/phpseclib/phpseclib> (package)

## Sources

- CVE List: [CVE-2026-40194](https://www.cve.org/CVERecord?id=CVE-2026-40194), CVE Terms of Use, modified 2026-05-08
- GitHub Advisory Database: [GHSA-r854-jrxh-36qx](https://github.com/advisories/GHSA-r854-jrxh-36qx), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2026-40194](https://nvd.nist.gov/vuln/detail/CVE-2026-40194), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2026-40194 · Whole record: https://cve.day/CVE-2026-40194.json · Rebuilt by cve.day 2026-11-25T22:59:18.549Z
