{"id":"CVE-2026-77463","aliases":["GO-2026-6945","GHSA-56x6-q882-mf27"],"title":"Remark42: Rate limit bypass via unconditional trust of X-Forwarded-For/X-Real-IP headers in direct-internet deployment","titleSource":"GitHub_M","descriptionSource":"OSV","declaredSeverity":"MODERATE","description":"### Summary\nRemark42 applied chi's `middleware.RealIP` globally, trusting `True-Client-IP` / `X-Real-IP` / `X-Forwarded-For` headers without verifying the request came from a trusted proxy. The per-IP rate limiters key on the overwritten `r.RemoteAddr`, so any client can bypass every per-IP rate limiter by rotating spoofed IP headers. The same spoofed IP also drives other per-IP controls (stored comment IP, anonymous identity derivation, and `--votes-ip` vote de-duplication). This affects deployments reachable directly from the internet (Remark42's built-in HTTP, static TLS, and ACME modes are all documented and supported), as well as any proxied deployment where the proxy forwards an attacker-controlled recognised header.\n\n### Details\nThe router applies `middleware.RealIP` globally, ahead of the per-route limiters, without any check that the server is behind a trusted proxy (in v1.16.1, `backend/app/rest/api/rest.go:207`).\n\nThe `rateLimiter` function (v1.16.1, `backend/app/rest/api/rest.go:769-779`) builds a tollbooth limiter with `IPLookup{Name: \"RemoteAddr\"}`, which reads `r.RemoteAddr`. Since chi's `middleware.RealIP` (v1.16.1, `backend/vendor/github.com/go-chi/chi/v5/middleware/realip.go:42-55`) unconditionally overwrites `r.RemoteAddr` from `True-Client-IP > X-Real-IP > first X-Forwarded-For` (accepting any syntactically valid IP), any client can set its apparent IP to an arbitrary value.\n\nThis bypasses every per-IP rate limiter that runs after `RealIP`: `/auth` (2/s), avatars (100/s), the image proxy (10/s), open / protected / admin route groups (10/s), root routes (50/s), and `/web/*` (20/s). Comment and vote creation go through the update limiter, whose server default is `UPDATE_LIMIT=0.5`/s (burst 1), not 10/s. The global 1,000 concurrent-request throttle still applies, so this is a per-IP-limit bypass rather than truly unlimited throughput. chi's own documentation warns that `middleware.RealIP` should be used only behind a trusted proxy.\n\n### PoC\n```bash\n# Deploy Remark42 reachable directly from the internet (built-in HTTP / TLS / ACME, no proxy that overwrites the headers).\n# Comment creation is limited to UPDATE_LIMIT (default 0.5/s, burst 1) per IP.\n\n# Rotate X-Real-IP across many requests; each distinct value gets its own token bucket.\nfor i in $(seq 1 100); do\n  curl -s -o /dev/null -w '%{http_code}\\n' \\\n    -H \"X-Real-IP: 192.0.2.$i\" \\\n    -X POST 'https://remark42.example.com/api/v1/comment?site=site1' \\\n    -H 'Authorization: Bearer YOUR_JWT' \\\n    -H 'Content-Type: application/json' \\\n    -d '{\"text\":\"spam\",\"locator\":{\"site\":\"site1\",\"url\":\"https://example.com/post\"}}'\ndone | sort | uniq -c\n# With rotating headers the responses stay 201; without them, requests beyond the burst return 429.\n```\n\n### Impact\nBy rotating the spoofed client IP an attacker bypasses the per-IP token buckets on all rate-limited endpoints and defeats other per-IP controls, enabling: (a) spam comment creation beyond the configured per-IP limit, (b) confirmation-email / notification flooding to supplied addresses, (c) high-volume outbound image fetching and resource consumption via the image proxy (its transport still blocks private/reserved destinations and DNS rebinding, so this is amplification, not new SSRF reach), (d) authentication-endpoint abuse, (e) where `--votes-ip` is enabled, defeating per-IP vote de-duplication (ballot stuffing), and (f) minting fresh anonymous identities and poisoning the stored comment IP and request logs, since the anonymous user ID is derived from `name + RemoteAddr`. The global concurrency ceiling and per-request timeouts remain, so availability impact is limited.\n\n### Resolution\nMitigation support was added in v1.16.2 (umputun/remark42#2116, follow-up in #2118). **Upgrading alone does not remediate the issue: `--trusted-proxy` must be configured.**\n\nThe fix adds `--trusted-proxy` / `TRUSTED_PROXY`. When set, the forwarding headers (`X-Real-IP`, then `CF-Connecting-IP`, then the leftmost public `X-Forwarded-For`) are honoured only when the direct TCP peer falls inside a trusted-proxy network; for a request from any other peer those headers are dropped and the real socket IP is used. When it is **unset**, the previous trust-all behaviour is preserved for backward compatibility and a startup warning is logged, so an un-configured v1.16.2 remains exploitable. `True-Client-IP` is no longer recognised. `TRUSTED_PROXY` takes a comma-separated list; on the command line, repeat `--trusted-proxy` per entry.\n\n**Required configuration:**\n- **Reachable directly from the internet:** set a value that no real client matches so the forwarding headers are always ignored, e.g. `--trusted-proxy=127.0.0.1/32` (only when Remark42 is not actually reached over loopback).\n- **Behind a reverse proxy:** point `--trusted-proxy` at the proxy's network only, block direct access to Remark42, and make the proxy **overwrite** `X-Real-IP` with the real client and discard client-supplied forwarding headers. A proxy that merely appends to `X-Forwarded-For`, or that forwards a client-supplied `X-Real-IP`, still lets the client choose the reported IP. Note that the shipped nginx manual sets `X-Real-IP` but does not strip a client `True-Client-IP`.\n- **Before v1.16.2:** strip `True-Client-IP`, `X-Real-IP`, and `X-Forwarded-For` at the edge and set a known-safe client-IP header.\n\nSee the [Trusted proxies and client IP docs](https://remark42.com/docs/configuration/parameters/#trusted-proxies-and-client-ip).","severity":"medium","score":6.5,"published":"2026-11-05T20:54:09.798Z","modified":"2026-11-23T20:40:46.861Z","withdrawn":false,"knownExploited":false,"affected":[{"ecosystem":"Go","name":"github.com/umputun/remark42","sources":[{"name":"OSV · GO-2026-6945","url":"https://osv.dev/vulnerability/GO-2026-6945"}],"ranges":[{"events":[{"introduced":"1.0.0"}],"type":"SEMVER"}],"versions":[],"fixed":[]},{"ecosystem":"Go","name":"github.com/umputun/remark42/backend","sources":[{"name":"OSV · GO-2026-6945","url":"https://osv.dev/vulnerability/GO-2026-6945"}],"ranges":[{"events":[{"introduced":"0"},{"fixed":"1.16.2"}],"type":"SEMVER"}],"versions":[],"fixed":["1.16.2"]},{"ecosystem":"Go","name":"github.com/umputun/remark42/backend","sources":[{"name":"OSV · GHSA-56x6-q882-mf27","url":"https://osv.dev/vulnerability/GHSA-56x6-q882-mf27"}],"ranges":[{"events":[{"introduced":"1.0.0"},{"fixed":"1.16.2"}],"type":"SEMVER"}],"versions":[],"fixed":["1.16.2"]},{"ecosystem":"Go","name":"github.com/umputun/remark42","sources":[{"name":"OSV · GHSA-56x6-q882-mf27","url":"https://osv.dev/vulnerability/GHSA-56x6-q882-mf27"}],"ranges":[{"events":[{"introduced":"1.0.0"},{"last_affected":"1.2.0"}],"type":"SEMVER"}],"versions":[],"fixed":[]}],"sourceAffected":[],"references":["https://github.com/umputun/remark42/security/advisories/GHSA-56x6-q882-mf27","https://github.com/umputun/remark42/pull/2116","https://github.com/umputun/remark42/pull/2118","https://github.com/umputun/remark42/commit/b1502801facd7782a1c70fd51f8ad5c2eb650d39","https://github.com/umputun/remark42/commit/e62b3c830d81659cf5d2687b0c8261da7d42fdab","https://github.com/umputun/remark42/releases/tag/backend/v1.16.2","https://remark42.com/docs/configuration/parameters/#trusted-proxies-and-client-ip","https://nvd.nist.gov/vuln/detail/CVE-2026-77463","https://github.com/umputun/remark42"],"sources":[{"name":"CVE","id":"CVE-2026-77463","modified":"2026-11-10T04:20:00.888Z","url":"https://www.cve.org/CVERecord?id=CVE-2026-77463"},{"name":"OSV","id":"GO-2026-6945","modified":"2026-11-23T20:30:12.539345440Z","url":"https://osv.dev/vulnerability/GO-2026-6945"},{"name":"OSV","id":"GHSA-56x6-q882-mf27","modified":"2026-11-23T20:40:46.861312864Z","url":"https://osv.dev/vulnerability/GHSA-56x6-q882-mf27"}],"assessments":[{"source":"GitHub_M","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L","score":6.5},{"source":"OSV","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L","score":6.5}],"cve":{"records":[{"id":"CVE-2026-77463","source":"GitHub_M","state":"PUBLISHED","reasons":[],"replacements":[],"disputed":false,"unsupportedWhenAssigned":false,"reserved":"2026-08-20T20:07:49.962Z","published":"2026-11-05T20:54:09.798Z","modified":"2026-11-10T04:20:00.888Z"}],"publishers":[{"name":"GitHub_M","role":"CNA","organizationId":"a0819718-46f1-4df5-94e2-005712e83aaa","modified":"2026-11-05T20:54:09.798Z"},{"name":"CISA-ADP","role":"ADP","organizationId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","modified":"2026-11-10T04:20:00.888Z"}],"references":[{"url":"https://github.com/umputun/remark42/security/advisories/GHSA-56x6-q882-mf27","tags":["x_refsource_CONFIRM"],"source":"GitHub_M"},{"url":"https://github.com/umputun/remark42/pull/2116","tags":["x_refsource_MISC"],"source":"GitHub_M"},{"url":"https://github.com/umputun/remark42/pull/2118","tags":["x_refsource_MISC"],"source":"GitHub_M"},{"url":"https://github.com/umputun/remark42/commit/b1502801facd7782a1c70fd51f8ad5c2eb650d39","tags":["x_refsource_MISC"],"source":"GitHub_M"},{"url":"https://github.com/umputun/remark42/commit/e62b3c830d81659cf5d2687b0c8261da7d42fdab","tags":["x_refsource_MISC"],"source":"GitHub_M"},{"url":"https://github.com/umputun/remark42/releases/tag/backend/v1.16.2","tags":["x_refsource_MISC"],"source":"GitHub_M"},{"url":"https://remark42.com/docs/configuration/parameters/#trusted-proxies-and-client-ip","tags":["x_refsource_MISC"],"source":"GitHub_M"},{"url":"https://github.com/umputun/remark42/security/advisories/GHSA-56x6-q882-mf27","tags":["exploit"],"source":"CISA-ADP"}],"weaknesses":[{"id":"CWE-348","description":"CWE-348: Use of Less Trusted Source","source":"GitHub_M"},{"id":"CWE-807","description":"CWE-807: Reliance on Untrusted Inputs in a Security Decision","source":"GitHub_M"}],"applicability":[],"prioritization":[{"source":"CISA-ADP","type":"SSVC","role":"CISA Coordinator","timestamp":"2026-11-10T04:19:02.667896Z","decisions":[{"name":"Exploitation","value":"poc"},{"name":"Automatable","value":"yes"},{"name":"Technical Impact","value":"partial"}]}]},"products":[{"vendor":"umputun","name":"remark42","platforms":[],"versions":[{"version":">= 1.0.0, < 1.16.2","status":"affected"}],"cpes":[],"source":"GitHub_M","url":"https://www.cve.org/CVERecord?id=CVE-2026-77463"}],"remediation":[],"observedAt":"2026-11-23T20:53:08.646Z","kev":{"status":"not-listed","checkedAt":"2026-11-28T20:50:30.811Z"},"coverage":[{"source":"NVD","status":"available","checkedAt":"2026-11-09T21:40:31.269Z","attemptedAt":"2026-11-09T21:40:31.269Z"},{"source":"GHSA","status":"available","checkedAt":"2026-11-09T21:40:31.821Z","attemptedAt":"2026-11-09T21:40:31.821Z"},{"source":"EUVD","status":"available","checkedAt":"2026-11-09T21:40:31.821Z","attemptedAt":"2026-11-09T21:40:31.821Z"},{"source":"EPSS","status":"available","checkedAt":"2026-11-09T21:40:31.821Z","attemptedAt":"2026-11-09T21:40:31.821Z"}],"evidence":[{"source":"NVD","id":"CVE-2026-77463","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-77463","modified":"2026-11-05T21:18:53.727","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L","checkedAt":"2026-11-09T21:40:31.269Z"},{"source":"GitHub Advisory Database","id":"GHSA-56x6-q882-mf27","url":"https://github.com/advisories/GHSA-56x6-q882-mf27","modified":"2026-11-09T21:18:30Z","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L","checkedAt":"2026-11-09T21:40:31.821Z"},{"source":"FIRST EPSS","id":"CVE-2026-77463","url":"https://www.first.org/epss/","probability":0.00219,"percentile":0.1245,"date":"2026-11-09","checkedAt":"2026-11-09T21:40:31.821Z"},{"source":"ENISA EUVD","id":"EUVD-2026-117799","url":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-117799","modified":"Nov 5, 2026, 8:54:09 PM","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L","checkedAt":"2026-11-09T21:40:31.821Z"}],"aiSummary":{"text":"Remark42 versions 1.0.0 to 1.16.1 have a rate limit bypass vulnerability due to unconditional trust of X-Forwarded-For/X-Real-IP headers, allowing attackers to bypass per-IP rate limiters. The vulnerability affects deployments reachable directly from the internet. An attacker can rotate spoofed IP headers to bypass rate limits.","model":"@cf/meta/llama-3.3-70b-instruct-fp8-fast","generatedAt":"2026-11-23T21:41:22.333Z","sources":[{"name":"CVE","url":"https://www.cve.org/CVERecord?id=CVE-2026-77463"},{"name":"OSV","url":"https://osv.dev/vulnerability/GO-2026-6945"},{"name":"OSV","url":"https://osv.dev/vulnerability/GHSA-56x6-q882-mf27"}]}}