-
Notifications
You must be signed in to change notification settings - Fork 584
Description
I have done the following
- I have searched the existing issues
- If possible, I've reproduced the issue using the 'main' branch of this project
Steps to reproduce
The invariant for host FQDNs for our lightweight DNS server is that container FQDNs shall be unique, so that it's not possible to have two address records for the same FQDN that refer to the same IP.
A basic check to prevent this occurs when the sandbox allocates an IP using an FQDN, but this check only has network scope.
The container uniqueness check also prevents many cases since we're forming FQDNs from container names.
Because we do not comprehensively check FQDNs at container create time to enforce the invariant, it is possible, though not straightforward, to violate the invariant.
Current behavior
sudo container system dns create testcontainer system dns default testcontainer run --rm -d --name web.test python:slim python3 -m http.server --bind 0.0.0.0 80container network create foocontainer run --rm -d --name web -w /tmp --network backend python:slim python3 -m http.server --bind 0.0.0.0 80 web
After step 5 a request to web.test may respond with the web server on either network (behavior depends on the lookup implementation):
% curl web.test
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Directory listing for /</title>
</head>
<body>
<h1>Directory listing for /</h1>
<hr>
<ul>
</ul>
<hr>
</body>
</html>Expected behavior
Step 5 should fail because the web.test FQDN is in use by the first container.
Environment
- OS: macOS 26 preview
- Xcode: 26 beta
- Container: mainRelevant log output
Code of Conduct
- I agree to follow this project's Code of Conduct