Skip to content

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

Merged
mpawlow merged 1 commit intorelease-saas-0.1from
mp/fix/saas/GH-1369-langflow-running-as-root-saas
Apr 13, 2026
Merged

fix: Security: Containerized Langflow application is running as root in Cloud / SaaS#1372
mpawlow merged 1 commit intorelease-saas-0.1from
mp/fix/saas/GH-1369-langflow-running-as-root-saas

Conversation

@mpawlow
Copy link
Copy Markdown
Collaborator

@mpawlow mpawlow commented Apr 10, 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 10, 2026
@github-actions github-actions bot added docker bug 🔴 Something isn't working. labels Apr 10, 2026
@mpawlow mpawlow changed the title fix: Security: Containerized Langflow application is running as root … fix: Security: Containerized Langflow application is running as root in Cloud / SaaS Apr 10, 2026
@github-actions github-actions bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Apr 10, 2026
@github-actions github-actions bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Apr 10, 2026
@mpawlow mpawlow requested a review from lucaseduoli April 13, 2026 16:35
Copy link
Copy Markdown
Collaborator

@lucaseduoli lucaseduoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions github-actions bot added the lgtm label Apr 13, 2026
@mpawlow mpawlow merged commit 51617b6 into release-saas-0.1 Apr 13, 2026
13 checks passed
@github-actions github-actions bot deleted the mp/fix/saas/GH-1369-langflow-running-as-root-saas branch April 13, 2026 18:32
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 lgtm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants