# CVE-2024-47178: basic-auth-connect timing-safe string comparison in authentication

Source: https://junglewise.ai/threats/cve-2024-47178-basic-auth-connect-timing-safe-string-comparison-in  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2024-09-30. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2024-47178 · Severity: low · CVSS 3.1 · Published 2024-09-30

basic-auth-connect is an Express.js middleware for HTTP Basic Authentication. The library uses a timing-unsafe string comparison when validating credentials, which allows attackers to leak authentication secrets through response-time analysis by measuring how long the comparison takes to reject invalid credentials.

Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2024-47178 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2024-47178 being exploited in the wild.

**How severe is CVE-2024-47178?** Low severity, with a CVSS score of 3.1, published 30 September 2024.

**Which products and versions are affected?** basic-auth-connect (npm) SEMVER:introduced=0,fixed=1.1.0.

**Is there a fix for CVE-2024-47178?** Yes. basic-auth-connect (npm): upgrade to 1.1.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2024-47178 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2024-47178?** Check whether you run basic-auth-connect (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- basic-auth-connect (npm): upgrade to 1.1.0 or later

  ```sh
  npm install basic-auth-connect@1.1.0
  ```


## Technical details

The vulnerability is a timing side-channel attack (CWE-208) in basic-auth-connect's credential validation callback. Versions before 1.1.0 use standard string comparison operators instead of constant-time comparison functions, allowing attackers on the network to distinguish valid from invalid credentials by measuring response time differences. The vulnerability requires no authentication or user interaction—any unauthenticated attacker can exploit it by sending crafted HTTP Basic Auth headers and timing the server responses. An attacker can progressively leak valid credentials character-by-character through repeated timing measurements. The fix, released in version 1.1.0, replaces the timing-unsafe comparison with a constant-time equality check.

## Affected products

- Express.js basic-auth-connect <1.1.0

## Identifiers

- CVE-2024-47178
- GHSA-7p89-p6hx-q4fw

## Timeline

- 2024-09-30: disclosed
- 2024-09-30: patched: Fixed in version 1.1.0

## References

- [https://github.com/expressjs/basic-auth-connect/security/advisories/GHSA-7p89-p6hx-q4fw](https://github.com/expressjs/basic-auth-connect/security/advisories/GHSA-7p89-p6hx-q4fw)
