fix(policy): reject TLD wildcard patterns in network policy endpoints#791
Merged
johntmyers merged 1 commit intomainfrom Apr 9, 2026
Merged
fix(policy): reject TLD wildcard patterns in network policy endpoints#791johntmyers merged 1 commit intomainfrom
johntmyers merged 1 commit intomainfrom
Conversation
TLD wildcards like *.com were accepted by policy validation but silently failed at the proxy layer — 0 bytes returned, no denial logged. Now rejected at submission time with a clear error message. Closes #787
pimlock
approved these changes
Apr 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TLD wildcards like
*.comwere accepted byopenshell policy setbut silently failed at the proxy layer — 0 bytes returned, connection closed, no denial logged. This makes them rejected at submission time with a clearInvalidArgumenterror.Related Issue
Closes #787
Changes
openshell-policy: AddedPolicyViolation::TldWildcardvariant and host validation invalidate_sandbox_policy()— rejects wildcard hosts with ≤2 DNS labels (e.g.,*.com,**.org)openshell-sandbox: Upgraded the "very broad wildcard" warning to a hard error invalidate_l7_policies()as defense-in-depthopenshell-server: Inherited rejection via existingvalidate_policy_safety()delegation — added test coverageTesting
mise run pre-commitpasses*.compolicy is rejected at submission and control policies (*.wikipedia.org,httpbin.org) still workChecklist