Root cause
Authentication & access control introduced
Initial commit — ciguard 0.1.0 ships the container image
How AI contributed: Direct introductionPublished May 5, 2026 in
jo-jo98/ciguardAll 4 findings in this repository
CWE-269 improper privilege management: the published container image inherited the default root user because the Dockerfile had no USER directive, so the analysis process ran as root. The advisory records a defence-in-depth gap: without a container-runtime escape in the chain the finding is not directly exploitable, but any future escape primitive would land on the host with root privileges instead of an unprivileged account. Version 0.8.2 fixed it by creating a dedicated account and switching the image to it.
ciguard's published container image never dropped the default root user, because the Dockerfile written for the first release carried no USER directive. The analyser needs no privileges, so running as root only widens the impact of an unrelated container-runtime flaw.
Root cause
Initial commit — ciguard 0.1.0 ships the container image
Fix
Creates a dedicated unprivileged account in the image, gives it ownership of the writable report and policy mounts, and switches the container to that account, so the analyser no longer runs as root.
Case facts
@@ -0,0 +1,25 @@+FROM python:3.12-slim++LABEL org.opencontainers.image.title="ciguard"+LABEL org.opencontainers.image.description="Static security auditor for CI/CD pipelines"+LABEL org.opencontainers.image.source="https://github.com/Jo-Jo98/ciguard"+LABEL org.opencontainers.image.licenses="Apache-2.0"++WORKDIR /app++# Install package + deps via pyproject.toml so the `ciguard` CLI entry point+# is available on PATH and the package is importable as `ciguard`.+COPY pyproject.toml README.md LICENSE ./+COPY src/ ./src/+COPY policies/ ./policies/+RUN pip install --no-cache-dir .++# Output volumes+RUN mkdir -p /reports /policies-mount++EXPOSE 8080++# Default: run the web server. Override for CLI use, e.g.:+# docker run --rm -v $PWD:/work ghcr.io/jo-jo98/ciguard \+# ciguard scan --input /work/.gitlab-ci.yml --output /work/report.html+CMD ["uvicorn", "ciguard.web.app:app", "--host", "0.0.0.0", "--port", "8080"]@@ -14,9 +14,15 @@ COPY src/ ./src/ COPY policies/ ./policies/ RUN pip install --no-cache-dir . -# Output volumes+# Output volumes (writable by the non-root user we'll switch to below) RUN mkdir -p /reports /policies-mount +# Run as a non-root user (defence-in-depth against container-runtime CVEs).+# Port 8080 is fine for non-root since it's >1024.+RUN groupadd -r ciguard && useradd -r -g ciguard -d /home/ciguard -m -s /usr/sbin/nologin ciguard \+ && chown -R ciguard:ciguard /reports /policies-mount /app+USER ciguard+ EXPOSE 8080 # Default: run the web server. Override for CLI use, e.g.:AI-assisted change 64c9f583151cceb03992cf1e2d7f72007bde269311893c19964b5b48750aeb0b · Fix 07084530145bd833a378c5620493a5ba746189fb22c514c52d2a15eb4cba1e1f