MEDIUM · CVSS 4.0 EPSS 0.3% · 25th percentile CWE-348

CVE-2026-86041: ezBookkeeping: Source-IP allowlist (MCP & API token) is bypassable via a spoofed `X-Forwarded-For` header

Published 2026-11-09 · Updated 2026-11-23 · Also known as GHSA-wchh-mrv2-5h4q, GO-2026-6949

Summary

ezBookkeeping fails to properly validate the X-Forwarded-For header because the underlying Gin framework defaults to trusting all proxies. Administrators must upgrade to version 1.6.0 or later to patch the IP allowlist bypass.

Who is affected

Affected deployments of ezBookkeeping using source-IP allowlists for MCP or API tokens are vulnerable to authorization bypass. An attacker can spoof their source IP address using the X-Forwarded-For header to appear as a trusted client, effectively neutralizing IP-based security controls and corrupting audit logs.

Exploitability

The vulnerability has a CVSS 4.0 base score reflecting low complexity and no special privileges required, as the attacker can manipulate headers from any network location. While the EPSS score of 0.003 indicates a low current probability of exploitation, the lack of CISA KEV listing suggests this is not currently being widely targeted in the wild.

Remediation

How to check your project

Automated analysis of the published advisory data, generated 2026-11-25. Not human-reviewed; verify against the official advisory. How this works.

Affected packages

EcosystemPackageAffected versionsFixed inUpgrade
Go github.com/mayswind/ezbookkeeping >= 0.10.0, < 1.6.0 1.6.0 go get github.com/mayswind/[email protected]

CVSS 4.0 vector

CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N

Attack vectorNetwork
Attack complexityLow
Attack requirementsNone
Privileges requiredLow
User interactionNone
Confidentiality (vulnerable system)None
Integrity (vulnerable system)Low
Availability (vulnerable system)None
Confidentiality (subsequent systems)None
Integrity (subsequent systems)None
Availability (subsequent systems)None

Base score is not computed for CVSS 4.0 vectors; severity is taken from the advisory.

FAQ

Does this vulnerability bypass the authentication layer?

No. This flaw only bypasses the compensating IP-based allowlist. Actions performed through the MCP or API still require valid credentials (e.g., valid tokens) to execute.

How does the X-Forwarded-For header impact system logs?

The application incorrectly logs the spoofed IP address provided in the X-Forwarded-For header instead of the actual client IP, which prevents accurate audit tracking and non-repudiation.

Is this vulnerability limited to specific network configurations?

Yes, it specifically impacts instances where the operator has enabled the 'mcp_allowed_remote_ips' or 'api_token_allowed_remote_ips' settings, as these are the controls neutralized by the header spoofing.

Original advisory description
### Summary A remote attacker from any IP address defeats the operator-configured source-IP allowlist (`mcp_allowed_remote_ips` / `api_token_allowed_remote_ips`) by sending a single `X-Forwarded-For: <allowlisted-ip>` header. The router is created with `gin.New()` and never calls `SetTrustedProxies`, so gin trusts every proxy by default and `c.ClientIP()` returns the attacker-supplied header verbatim. The same forged value is also written to `Transaction.CreatedIp` and the access log, so the attacker's real IP never appears in any record. ### Details `cmd/webserver.go:104` builds the router with `gin.New()`. A grep of `cmd/` and `pkg/` confirms `SetTrustedProxies` is never called, leaving gin's default trusted-proxy range of `0.0.0.0/0` and `::/0`. `WebContext` (`pkg/core/context_web.go:39`) embeds `*gin.Context` and does not override `ClientIP()`. Both allowlist middlewares match the operator allowlist against this attacker-controlled value: ```go // pkg/middlewares/mcp_server_ip_limit.go:19 if config.MCPAllowedRemoteIPs[i].Match(c.ClientIP()) { c.Next(); return } ``` The identical `c.ClientIP()` is consumed by the audit trail at `pkg/api/transactions.go:1078` (`createNewTransactionModel(..., c.ClientIP())` → `CreatedIp`) and the access log (`pkg/middlewares/request_log.go:28`), so one header both bypasses the gate and forges attribution. ### PoC Runtime PoC (no live deployment required) - `pkg/middlewares/xff_bypass_runtime_test.go`, `pkg/middlewares/xff_chain_runtime_test.go`: ``` go test ./pkg/middlewares/ -run 'TestACCESSCONTROL001_XFFBypass|TestCHAIN_AllowlistBypass' -v ``` Output: ``` [control] no XFF, RemoteAddr=1.2.3.4 -> status=400 (correctly blocked) [exploit] XFF=10.0.0.1, RemoteAddr=1.2.3.4 -> status=200, ClientIP=10.0.0.1 (bypassed) gate status = 200 | created_ip that would be persisted = "10.0.0.1" ``` Against a live instance with `mcp_allowed_remote_ips=10.0.0.1`: ``` curl -s -o /dev/null -w "%{http_code}\n" https://target/mcp # 403 (blocked) curl -s -o /dev/null -w "%{http_code}\n" -H "X-Forwarded-For: 10.0.0.1" https://target/mcp # passes IP gate ``` ### Impact Defeats an explicitly advertised, operator-configured security control on the MCP and API-token surfaces, from any source IP, with a single header and no authentication to the gate itself. It also destroys non-repudiation: every action is logged under the spoofed allowlisted IP, so audit trails point at the trusted host instead of the attacker. (The MCP/API actions themselves still require a valid token - this neutralizes the compensating IP control, not the JWT layer.)

References

Source records: GHSA-wchh-mrv2-5h4q, GO-2026-6949 (OSV.dev) · EPSS by FIRST, 2026-11-25.