Skip to content

Close OIDC path aliases and bound nonce verification cost - #1478

Merged
lovasoa merged 2 commits into
mainfrom
codex/oidc-security-fixes
Sep 23, 2026
Merged

lovasoa merged 2 commits into
mainfrom
codex/oidc-security-fixes

Conversation

@lovasoa

@lovasoa lovasoa commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

Configured OIDC protected URL prefixes could be bypassed through alternate spellings of the same filesystem path or by using a clean URL that resolves to a protected SQL file. The middleware now normalizes request paths, checks the resolved SQL route, and passes that authorized route to the main handler so it cannot change between authorization and dispatch. Public path overrides remain explicit.

The OIDC nonce callback now rejects oversized or nonstandard Argon2 PHC hashes before verification. Only SQLPage's fixed low-cost Argon2id profile is accepted, preventing a provider-returned nonce from forcing expensive hashing work.

Regression tests cover dot, separator, case, extensionless, index, and custom 404 aliases, plus altered nonce hash parameters. Configuration and OIDC documentation describe the new behavior.

Validation: cargo fmt --all; cargo clippy --all-targets --all-features -- -D warnings; cargo test --lib (222 passed); cargo test --test mod oidc (14 passed).

Comment thread configuration.md
| `max_uploaded_file_size` | 5242880 | Maximum size of forms and uploaded files in bytes. Defaults to 5 MiB. |
| `oidc_protected_paths` | `["/"]` | A list of URL prefixes that should be protected by OIDC authentication. By default, all paths are protected (`["/"]`). If you want to make some pages public, you can restrict authentication to a sub-path, for instance `["/admin", "/users/settings"]`. All paths must start with a "/" and will be prepended by `site_prefix` if defined. When set through an environment variable, use a space-separated list, such as `/admin /users/settings`.|
| `oidc_protected_paths` | `["/"]` | A list of URL prefixes that should be protected by OIDC authentication. By default, all paths are protected (`["/"]`). If you want to make some pages public, you can restrict authentication to a sub-path, for instance `["/admin", "/users/settings"]`. Decoded dot and repeated-separator aliases are normalized before matching, and protected prefixes also match ASCII case aliases on case-insensitive storage. All paths must start with a "/" and will be prepended by `site_prefix` if defined. When set through an environment variable, use a space-separated list, such as `/admin /users/settings`.|
| `oidc_public_paths` | `[]` | A list of URL prefixes that should be publicly available. By default, no paths are publicly accessible (`[]`). If you want to make some pages public, you can bypass authentication for a sub-path, for instance `["/public/", "/assets/"]`. Keep in mind that without the closing backslashes, that any directory or file starting with `public` or `assets` will be publicly available. This will also overwrite any protected path restriction. If you have a private path `/private` and you define the public path `/private/public/` everything in `/private/public/` will be publicly accessible, while everything else in private will still need authentication. All paths must start with a "/" and will be prepended by `site_prefix` if defined. When set through an environment variable, use a space-separated list, such as `/public/ /assets/`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to update this one as well? if not LGTM!

@lovasoa
lovasoa merged commit 68b374e into main Sep 23, 2026
52 checks passed
@lovasoa
lovasoa deleted the codex/oidc-security-fixes branch September 23, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants