Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@thevilledev
Copy link

@thevilledev thevilledev commented Sep 18, 2025

Add a cycle guard for Caddyfile snippet imports. Track snippet expansions with a hard cap (1000) and error on trivial self-imports in snippet bodies to prevent infinite recursion.

Add tests for snippet self-import, to validate the newly added failure state. Run the TestSnippetImportCycle test against master branch and you will see it times out:

$ go test ./caddyfile -timeout=5s -run ^TestSnippetImportCycle$
panic: test timed out after 5s

Originally found in OSS-Fuzz issue #42486385 while fuzzing CoreDNS.

Once merged, could we publish a new release and bump the dependency in CoreDNS?

Add a cycle guard for Caddyfile snippet imports. Track snippet
expansions with a hard cap (1000) and error on trivial self-imports
in snippet bodies to prevent infinite recursion. Add tests for
snippet self-import failure.

Signed-off-by: Ville Vesilehto <[email protected]>
@thevilledev
Copy link
Author

cc @miekg @yongtang - just realised there's no CODEOWNERS file present in the repo, thus no notifications 😃

@yongtang yongtang merged commit fabd98a into coredns:master Sep 19, 2025
1 check passed
jdamick pushed a commit to jdamick/caddy that referenced this pull request Sep 25, 2025
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