ory/hydra · error
base64 loader disabled
Error message
base64 loader disabled
What it means
Returned by readFile when the source URL scheme is base64:// but the Base64 loader was explicitly turned off via WithDisabledBase64Loader. It is a policy guard, not a decoding failure: the input itself may be valid, the loader is simply disallowed in this configuration.
Source
Thrown at oryx/osx/file.go:191
return nil, errors.Wrap(err, "unable to read the file")
}
case "http", "https":
if o.disableHTTPLoader {
return nil, errors.New("http(s) loader disabled")
}
resp, err := o.hc.Get(parsed.String())
if err != nil {
return nil, errors.Wrap(err, "unable to load remote file")
}
defer resp.Body.Close()
bytes, err = io.ReadAll(resp.Body)
if err != nil {
return nil, errors.Wrap(err, "unable to read the HTTP response body")
}
case "base64":
if o.disableBase64Loader {
return nil, errors.New("base64 loader disabled")
}
if o.disableResilientBase64Loader {
bytes, err = o.base64enc.DecodeString(strings.TrimPrefix(source, "base64://"))
if err != nil {
return nil, errors.Wrap(err, "unable to base64 decode the location")
}
return bytes, nil
}
for _, enc := range []*base64.Encoding{
base64.StdEncoding,
base64.URLEncoding,
base64.RawURLEncoding,
base64.RawStdEncoding,
} {
bytes, err = enc.DecodeString(strings.TrimPrefix(source, "base64://"))
if err == nil {View on GitHub (pinned to 4174065ffb)
Solutions
- Remove the WithDisabledBase64Loader option if base64 sources are expected
- Provide the file content via an allowed scheme (plain path, file://, http(s)://) instead of base64://
- If embedding data is required, pass the decoded bytes directly rather than as a URL source
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at oryx/osx/file.go:191 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of ory/hydra@4174065ffb (2026-09-03).
Data as JSON: /api/errors/d5ae3d5e4cbecc92.
Report an issue: GitHub.