Summary
ArtifactBoundaryGuard (qwed_infra/guards/artifact_boundary_guard.py, _check_build_config) reads only pyproject.toml and only the package dir, but hatchling builds from more configuration and more files. Three gaps let forbidden content ship (including secrets and executed build-time code) while the guard reports VERIFIED/ADMIT.
Affected
qwed-infra <= 0.3.0 (verified on main @ b3098be = v0.3.0; PoCs built with hatchling 1.28.0). No patched version yet.
Details
hatch.tomlignored: onlypyproject.tomlis loaded, but hatchling mergeshatch.tomlover[tool.hatch]. PoC: cleanpyproject.toml+hatch.tomlwith[build.targets.wheel.force-include] "secrets/.env"="mypkg/.env" > guard VERIFIED/ADMIT, wheel containsmypkg/.env. With a hooks table inhatch.toml, build-time code runs (canary written). Control (same force-include inpyproject.toml`) is BLOCKED.[project]readme/license-files never inspected: the[project]table is never read. PoC:license-files = ["deploy/*", ".env"],readme = {file=".env"}> guard VERIFIED/ADMIT, wheel shipsdist-info/licenses/.envanddist-info/licenses/deploy/id_ed25519(a private key); METADATA containsDB_PASSWORD, displayed publicly on PyPI. Variant:readme = ../host_credentialsships paths outside the project root.[tool.hatch.version] source = "code"and[tool.hatch.metadata.hooks.*]never read. PoC: version sourcecodewithpath = "tools/ver.py"> guard VERIFIED/ADMIT, hatchling executestools/ver.pyduring the build (canary written).
Impact
Secrets/private keys ship in wheels, build-time code executes, and PyPI-visible metadata leaks secrets — all under a VERIFIED/ADMIT verdict.
Fix direction
Read the whole hatchling configuration (hatch.toml, [project] readme/license-files, version source, metadata hooks) and reject unmodelled keys; allowlist readme/license-files to root README*/LICENSE* (no .., no absolute paths) and scan them. Long term: certify the built wheel RECORD, not the source tree.
CWE
CWE-693 (Protection Mechanism Failure); secret-shipping aspect CWE-538.
