{"vuln_id":"CVE-2026-86041","aliases":["GHSA-wchh-mrv2-5h4q"],"description":"ezBookkeeping: Source-IP allowlist (MCP & API token) is bypassable via a spoofed `X-Forwarded-For` header","published_at":"2026-11-09T21:51:28Z","modified_at":"2026-11-23T20:41:08.220900Z","first_seen_at":"2026-11-23T21:06:31.536241Z","severity":"medium","severity_source":"native","cvss_score":null,"cvss_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","cwe":["CWE-348"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.00316,"epss_percentile":0.24911,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-86041"},"matched_alias":null,"items":[{"id":16655,"source":{"id":"osv","name":"OSV.dev"},"title":"GO-2026-6949: ezBookkeeping: Source-IP allowlist (MCP & API token) is bypassable via a spoofed `X-Forwarded-For` header in github.com/mayswind/ezbookkeeping","summary":"ezBookkeeping: Source-IP allowlist (MCP & API token) is bypassable via a spoofed `X-Forwarded-For` header in github.com/mayswind/ezbookkeeping\n\nAffected: Go:github.com/mayswind/ezbookkeeping\n\nFixed in: 1.6.0\n\nReferences:\nhttps://github.com/mayswind/ezbookkeeping/security/advisories/GHSA-wchh-mrv2-5h4q\nhttps://nvd.nist.gov/vuln/detail/CVE-2026-86041\nhttps://github.com/mayswind/ezbookkeeping/commit/d79a5beb8037e529dc4dc64a6d22bd2d02b2e986\nhttps://github.com/mayswind/ezbookkeeping/releases/tag/v1.6.0","url":"https://osv.dev/vulnerability/GO-2026-6949","published_at":"2026-11-23T20:02:42Z","updated_at":"2026-11-23T20:30:12.602738Z","fetched_at":"2026-11-23T21:06:31.109648Z","severity":"medium","cvss_score":null,"epss":0.00316,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"github.com/mayswind/ezbookkeeping","vuln_id":"CVE-2026-86041","vuln_ids":["CVE-2026-86041","GHSA-WCHH-MRV2-5H4Q","GO-2026-6949"],"tags":["osv","go","fix-available"],"cluster_id":14748,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/16655","html":"https://vulnwatch.ve1ve2.com/item/16655"}},{"id":16577,"source":{"id":"osv","name":"OSV.dev"},"title":"GHSA-wchh-mrv2-5h4q: ezBookkeeping: Source-IP allowlist (MCP & API token) is bypassable via a spoofed `X-Forwarded-For` header","summary":"ezBookkeeping: Source-IP allowlist (MCP & API token) is bypassable via a spoofed `X-Forwarded-For` header ### 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: ` 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.) Affected: Go:github.com/mayswind/ezbookkeeping Fixed in: 1.6.0 References: https://github.com/mayswind/ezbookkeeping/security/advisories/GHSA-wchh-mrv2-5h4q https://nvd.nist.gov/vuln/detail/CVE-2026-86041 https://github.com/mayswind/ezbookkeeping/commit/d79a5beb8037e529dc4dc64a6d22bd2d02b2e986 https://github.com/mayswind/ezbookkeeping https://github.com/mayswind/ezbookkeeping/releases/tag/v1.6.0","url":"https://osv.dev/vulnerability/GHSA-wchh-mrv2-5h4q","published_at":"2026-11-09T21:51:28Z","updated_at":"2026-11-23T20:41:08.220900Z","fetched_at":"2026-11-23T21:06:31.109578Z","severity":"medium","cvss_score":null,"epss":0.00316,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"github.com/mayswind/ezbookkeeping","vuln_id":"CVE-2026-86041","vuln_ids":["CVE-2026-86041","GHSA-WCHH-MRV2-5H4Q","GO-2026-6949"],"tags":["osv","go","fix-available"],"cluster_id":14747,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/16577","html":"https://vulnwatch.ve1ve2.com/item/16577"}}]}