Hotfix/fix polars code parser vulnerability#355
Merged
Edwardvaneechoud merged 10 commits intomainfrom Mar 16, 2026
Merged
Conversation
…e writes Polars write_database() with the sqlalchemy engine requires pandas at runtime. Both pandas and sqlalchemy were previously dev-only dependencies, causing database_writer nodes to fail in Docker where only main deps are installed. https://claude.ai/code/session_013oAgzvWawNqytnCiPxUQPH
SQLAlchemy requires a DBAPI driver (psycopg2) to connect to PostgreSQL. It was previously dev-only, causing database writes to fail in Docker with "No module named 'psycopg2'". https://claude.ai/code/session_013oAgzvWawNqytnCiPxUQPH
✅ Deploy Preview for flowfile-wasm canceled.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant improvements to the security of the Polars code execution sandbox, enhances documentation clarity, and adds comprehensive tests for the new security features. The most important changes are summarized below.
Security hardening for Polars code execution:
PolarsCodeParsernow enforces a strict set of blocked functions (e.g.,open,exec,eval,__import__, etc.), blocks all import statements, and restricts access to dunder (double underscore) attributes and strings, preventing common sandbox escape vectors. Additionally, the execution environment's__builtins__is set to an empty dictionary to block access to all built-in functions unless explicitly allowed. [1] [2]Expanded security test coverage:
TestPolarsCodeParserSecurityclass is added with extensive tests covering blocked function calls, import statements, dunder access, bypass attempts, and runtime enforcement to ensure the sandbox is robust against known and potential attacks. The tests also verify that allowed operations and Polars functionality continue to work as expected.Documentation improvements:
Other code and test maintenance: