Title: bug: OIDC/OAuth provider responses are decoded without a size limit · Issue #32452 · coder/coder · GitHub
Open Graph Title: bug: OIDC/OAuth provider responses are decoded without a size limit · Issue #32452 · coder/coder
X Title: bug: OIDC/OAuth provider responses are decoded without a size limit · Issue #32452 · coder/coder
Description: Is there an existing issue for this? I have searched the existing issues Current Behavior OIDC discovery (ResolveIssuer), external-auth token validation (Config.ValidateToken), token revocation (Config.RevokeToken), and device authorizat...
Open Graph Description: Is there an existing issue for this? I have searched the existing issues Current Behavior OIDC discovery (ResolveIssuer), external-auth token validation (Config.ValidateToken), token revocation (Co...
X Description: Is there an existing issue for this? I have searched the existing issues Current Behavior OIDC discovery (ResolveIssuer), external-auth token validation (Config.ValidateToken), token revocation (Co...
Opengraph URL: https://github.com/coder/coder/issues/32452
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bug: OIDC/OAuth provider responses are decoded without a size limit","articleBody":"### Is there an existing issue for this?\n\n- [x] I have searched the existing issues\n\n### Current Behavior\n\nOIDC discovery (ResolveIssuer), external-auth token validation (Config.ValidateToken), token revocation (Config.RevokeToken), and device authorization (DeviceAuth.AuthorizeDevice) decode the provider response with json.NewDecoder(resp.Body).Decode or io.ReadAll without a size limit. A misbehaving, misconfigured, or compromised provider can return a very large body, causing unbounded memory growth in coderd. These paths use raw decoders/ReadAll and bypass the bounded httpapi.Read introduced in #28168. The\nprovider URLs are deployment-configured (CODER_OIDC_ISSUER_URL / CODER_EXTERNAL_AUTH_*), so this is a robustness/hardening issue rather than a user-controlled remote vulnerability.\n\n### Relevant Log Output\n\n```shell\nSame-package reproduction (Go 1.26, project Docker test image), counting reader\nover the provider response body:\n\nU4ee8f4de ResolveIssuer:\nARM=benign REACHED=yes BLOCKED_AT=none\nARM=benign RESULT parsed_bytes=5\nARM=malicious REACHED=yes BLOCKED_AT=none\nARM=malicious RESULT parsed_bytes=2097152\n\nU143a8bf0 DeviceAuth.AuthorizeDevice:\nARM=benign REACHED=yes BLOCKED_AT=none\nARM=benign RESULT parsed_bytes=5\nARM=malicious REACHED=yes BLOCKED_AT=none\nARM=malicious RESULT parsed_bytes=2097152\n\nU516f267b Config.ValidateToken:\nARM=benign REACHED=yes BLOCKED_AT=none\nARM=benign RESULT parsed_bytes=5\nARM=malicious REACHED=yes BLOCKED_AT=none\nARM=malicious RESULT parsed_bytes=2097152\n\nU016804d5 Config.RevokeToken:\nARM=benign REACHED=yes BLOCKED_AT=none\nARM=benign RESULT read_bytes=33\nARM=malicious REACHED=yes BLOCKED_AT=none\nARM=malicious RESULT read_bytes=2097180\n```\n\n### Expected Behavior\n\nA shared maximum size (e.g. 1 MiB) should bound outbound OIDC/OAuth response reads, or the MaxBytesReader pattern introduced for httpapi.Read should be reused; over-limit responses should fail with a clear error.\n\n### Steps to Reproduce\n\n1. Checkout commit 612b6d4e (or current main; these paths are still unbounded).\n2. In a same-package Go test, use an httptest server or injected RoundTripper\n that returns a ~2 MiB JSON response.\n3. Call ResolveIssuer, Config.ValidateToken, Config.RevokeToken, or\n DeviceAuth.AuthorizeDevice.\n4. Observe the full body is decoded/read with no size rejection.\n\nAll steps are local; no external IdP is contacted. The same pattern applies to\nthe real deployment-configured provider endpoints.\n\n### Environment\n\n- Host OS:\n- Coder version:\n\n\n### Additional Context\n\n_No response_","author":{"url":"https://github.com/GG-Feng","@type":"Person","name":"GG-Feng"},"datePublished":"2026-11-19T15:32:39Z","url":"https://github.com/coder/coder/issues/32452"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d206cc64-9834-2cd9-227a-01241e5c6bdd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B2C0:18DF23:3CEC7:51223:6B042D9F |
| html-safe-nonce | e86e78ff2df1fa5f4facede9f2488d2da4768f3570a72d72aefa1df2924ca992 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMkMwOjE4REYyMzozQ0VDNzo1MTIyMzo2QjA0MkQ5RiIsInZpc2l0b3JfaWQiOiI0NTE5MjEwOTE2MTYzODkwNTkxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f4fafd51910d634fc8bbd553513a5b3854f4b5070076cc44059756ccb0987230 |
| hovercard-subject-tag | issue:6493101475 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/coder/32452/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3ff6f6ee85004f9a369fc41b84a73ef3ae55479465b7bdf73e3028e961f8b784/coder/coder/issues/32452 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3ff6f6ee85004f9a369fc41b84a73ef3ae55479465b7bdf73e3028e961f8b784/coder/coder/issues/32452 |
| og:image:alt | Is there an existing issue for this? I have searched the existing issues Current Behavior OIDC discovery (ResolveIssuer), external-auth token validation (Config.ValidateToken), token revocation (Co... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | GG-Feng |
| hostname | github.com |
| expected-hostname | github.com |
| None | b7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e |
| turbo-cache-control | no-preview |
| go-import | github.com/coder/coder git https://github.com/coder/coder.git |
| octolytics-dimension-user_id | 95932066 |
| octolytics-dimension-user_login | coder |
| octolytics-dimension-repository_id | 440752086 |
| octolytics-dimension-repository_nwo | coder/coder |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 440752086 |
| octolytics-dimension-repository_network_root_nwo | coder/coder |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c3dd496c3da6ea6b77e69c09279d2b81604654f1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width