{"record":{"id":"07283582b98ab450","repo":"jdx/mise","slug":"github-actions-oidc-request-url-must-use-https","errorCode":null,"errorMessage":"GitHub Actions OIDC request URL must use HTTPS","messagePattern":"GitHub Actions OIDC request URL must use HTTPS","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/mise-cache-core/src/lib.rs","lineNumber":1103,"sourceCode":"fn unix_timestamp() -> Result<u64> {\n    Ok(SystemTime::now()\n        .duration_since(UNIX_EPOCH)\n        .map_err(|err| eyre!(\"system clock is before the Unix epoch: {err}\"))?\n        .as_secs())\n}\n\nfn validate_oidc_request_url(url: &Url) -> Result<()> {\n    if url.scheme() == \"https\"\n        || url.scheme() == \"http\"\n            && url.host().is_some_and(|host| match host {\n                Host::Domain(host) => host.eq_ignore_ascii_case(\"localhost\"),\n                Host::Ipv4(address) => address.is_loopback(),\n                Host::Ipv6(address) => address.is_loopback(),\n            })\n    {\n        Ok(())\n    } else {\n        bail!(\"GitHub Actions OIDC request URL must use HTTPS\")\n    }\n}\n\nfn validate_remote_url(base_url: &Url, authenticated: bool) -> Result<()> {\n    if base_url.scheme() == \"https\" {\n        return Ok(());\n    }\n    if base_url.scheme() != \"http\" {\n        bail!(\"remote cache URL must use HTTPS\");\n    }\n    let is_loopback = base_url.host().is_some_and(|host| match host {\n        Host::Domain(host) => host.eq_ignore_ascii_case(\"localhost\"),\n        Host::Ipv4(address) => address.is_loopback(),\n        Host::Ipv6(address) => address.is_loopback(),\n    });\n    if !is_loopback && authenticated {\n        bail!(\"remote cache URL must use HTTPS except for loopback development servers\");\n    }","sourceCodeStart":1085,"sourceCodeEnd":1121,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/crates/mise-cache-core/src/lib.rs#L1085-L1121","documentation":"The GitHub Actions OIDC token request URL is validated to require HTTPS unless it is a loopback address. A non-HTTPS, non-loopback URL would send OIDC secrets over plaintext, so it is rejected outright.","triggerScenarios":"validate_github_oidc_url (or equivalent) receives a request URL whose scheme is not https and whose host is not a loopback IPv4/IPv6 address — e.g. http://token.example.com or a plain hostname.","commonSituations":"Typo in the OIDC endpoint URL, self-hosted token proxy exposed over HTTP, misconfigured ACTIONS_ID_TOKEN_REQUEST_URL override in CI, pointing at an internal http:// service.","solutions":["Change the URL scheme to https:// (e.g. https://token.actions.githubusercontent.com)","If developing locally, use a loopback host like http://127.0.0.1:PORT which is explicitly allowed","Put TLS in front of your token proxy (reverse proxy with certificates) instead of plain HTTP","Check environment overrides for the OIDC URL for stray http:// values"],"exampleFix":"// before\nlet url = Url::parse(\"http://token.internal.example.com\")?;\n// after\nlet url = Url::parse(\"https://token.internal.example.com\")?;","handlingStrategy":"validation","validationCode":"let url = Url::parse(oidc_url)?;\nif url.scheme() != \"https\" {\n    let loopback = matches!(url.host(), Some(url::Host::Ipv4(a)) if a.is_loopback());\n    if !loopback {\n        return Err(\"OIDC URL must be HTTPS\".into());\n    }\n}","typeGuard":"fn is_https_or_loopback(url: &Url) -> bool {\n    url.scheme() == \"https\"\n        || matches!(url.host(),\n            Some(url::Host::Ipv4(a)) if a.is_loopback())\n}","tryCatchPattern":"if let Err(e) = validate_github_oidc_url(&url) {\n    eprintln!(\"config error: {e}; set https://token.actions.githubusercontent.com\");\n}","preventionTips":["Never hand-write the OIDC URL; derive it from ACTIONS_ID_TOKEN_REQUEST_URL","Put TLS on any custom token proxy","Review CI env overrides for http:// values"],"tags":["oidc","url","security","https"],"backgroundTag":"invalid-url-format","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}