Skip to content

fix: Security: Containerized Langflow application is running as root in Cloud / SaaS#1370

Open
mpawlow wants to merge 1 commit intomainfrom
mp/fix/GH-1369-langflow-running-as-root-saas
Open

fix: Security: Containerized Langflow application is running as root in Cloud / SaaS#1370
mpawlow wants to merge 1 commit intomainfrom
mp/fix/GH-1369-langflow-running-as-root-saas

Conversation

@mpawlow
Copy link
Copy Markdown
Collaborator

@mpawlow mpawlow commented Apr 9, 2026

Issue

Summary

  • Removes the USER root escalation from Dockerfile.langflow and eliminates the associated custom langflow-entrypoint.py script that ran as root to fix bind-mount permissions before dropping privileges
  • The Langflow container now runs exclusively as the non-root user (uid=1000) inherited from the base image throughout its entire lifecycle, eliminating the security risk of running as root in Cloud / SaaS deployments

Security Fix: Remove Root User Execution from Langflow Container

  • Root cause: Dockerfile.langflow previously issued a USER root instruction after copying the entrypoint script, causing the container process to start (and remain) as root in Cloud / SaaS environments
  • Previous workaround: A custom scripts/langflow-entrypoint.py was introduced to:
    • Run as root at startup to chmod 0o777 the /app/langflow-data bind-mount directory
    • Drop privileges to uid=1000 / gid=1000 (the langflow user) before exec-ing the main process
    • Restore HOME and USER environment variables after the privilege drop
    • This workaround was originally needed for macOS/Podman environments where the virtiofs layer does not faithfully propagate host-side chmod changes into the container
  • Fix applied:
    • Removed the USER root instruction from Dockerfile.langflow
    • Removed the COPY --chmod=755 scripts/langflow-entrypoint.py /usr/local/bin/langflow-entrypoint layer
    • Removed the ENTRYPOINT ["langflow-entrypoint"] override
    • Deleted scripts/langflow-entrypoint.py entirely (43 lines removed)
    • The container now uses the default CMD ["langflow", "run", "--host", "0.0.0.0", "--port", "7860"] with no custom entrypoint

@mpawlow mpawlow self-assigned this Apr 9, 2026
@github-actions github-actions Bot added docker bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🔴 Something isn't working. docker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant