Skip to content

Validate Okta issuer URLs before use#41

Closed
YoungJinJung wants to merge 2 commits into
mainfrom
issue-31-validate-okta-issuer
Closed

Validate Okta issuer URLs before use#41
YoungJinJung wants to merge 2 commits into
mainfrom
issue-31-validate-okta-issuer

Conversation

@YoungJinJung

@YoungJinJung YoungJinJung commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Validate Okta issuer URLs in the CLI before building device-flow endpoints.
  • Validate Okta issuer URLs in the keyserver before publishing auth config or calling userinfo.
  • Reject non-HTTPS issuers, localhost/private/link-local IP hosts, and query/fragment components.
  • Add Go and Python regression tests.

Closes #31.

Validation

  • env -u GOROOT -u GOPATH /opt/homebrew/bin/go test ./...
  • PYTHONPATH=. python3 -m unittest discover keyserver/tests

Add the local keyserver service, CLI publish/login/fetch commands, compose smoke wiring, and tests as a reviewable baseline for the security hardening work stacked above it.

Constraint: Security fixes for issues #30-#34 target files that are not yet present on main.
Rejected: Fold all security fixes into one PR | would make review and issue closure harder.
Confidence: medium
Scope-risk: broad
Directive: Review this foundation before merging stacked hardening PRs into main.
Tested: PYTHONPATH=. python3 -m unittest discover keyserver/tests; env -u GOROOT -u GOPATH /opt/homebrew/bin/go test ./...
Not-tested: Docker compose smoke test was not run locally.
Both the CLI and keyserver now parse and reject unsafe Okta issuer URLs before constructing OAuth or userinfo endpoints, preventing token exchange against non-HTTPS, localhost, private-network, or query-injected issuers.

Constraint: Validation must stay dependency-free and avoid DNS lookups during local command execution.
Rejected: Resolve DNS to classify private networks | adds latency and can create surprising network access during validation.
Confidence: high
Scope-risk: moderate
Directive: Do not build OAuth endpoints by raw string concatenation before issuer validation.
Tested: env -u GOROOT -u GOPATH /opt/homebrew/bin/go test ./...; PYTHONPATH=. python3 -m unittest discover keyserver/tests
Related: #31

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This PR implements comprehensive validation for Okta issuer URLs in both the CLI and keyserver to prevent security vulnerabilities including downgrade attacks, SSRF, and URL manipulation. The implementation includes proper error handling, consistent validation logic across Go and Python implementations, and thorough test coverage for both valid and invalid cases. The security validations correctly reject non-HTTPS URLs, localhost/private/link-local IPs, and URLs with query/fragment components while accepting valid HTTPS URLs. No blocking defects identified.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

@YoungJinJung YoungJinJung changed the base branch from keyserver-foundation to main June 16, 2026 06:19
@YoungJinJung

Copy link
Copy Markdown
Contributor Author

Closing because this was opened against the wrong repository. The security triage is being redone against companyjupiter/quarkify.

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.

Validate Okta issuer URLs before OAuth and userinfo requests

1 participant