fix(security): constrain config-driven code execution - #2340
Open
XianBW (XianBW) wants to merge 22 commits into
Open
XianBW (XianBW) wants to merge 22 commits into
XianBW (XianBW) wants to merge 22 commits into
Conversation
Collaborator
Author
|
Local verification update:
The branch also contains minimal CI compatibility fixes for current Node/commitlint, Plotly, MLflow, and Windows/Python 3.8 OSQP behavior. |
Collaborator
Author
|
Final verification: all 76 GitHub checks pass on commit |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Match the repr-formatted module path in refusal messages and cover Windows, UNC, quoted, and newline-containing paths on every platform. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Log ExpressionSyntaxError with its field and traceback before re-raising, while preserving custom operator NameError and SyntaxError handling. Add five regression cases covering logging, exception identity, and failed cache entries. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Capture parser logs directly on qlib.data without propagating to parent and root capture handlers. Restore logger state with monkeypatch and retain exact single-record, traceback, and exception-identity assertions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Changes
eval()in feature expressions and disk expression caching with a restricted AST interpreter. Preserve registered operators and safe parameter syntax, including bounded containers, argument unpacking, indexing/slicing, and scalar conditions.trusted=Truefor file-module imports, defaulting to refusal. Keep legacy module aliases for restoring trusted older file-based models.Compatibility and migration
Package imports and standard Alpha158/Alpha360 expressions remain supported without opt-in. File-based components must explicitly authorize their imports:
Direct imports use
get_module_by_module_path(path, trusted=True). Each nested file component needs its own consent; there is no global grant. Top-leveltrustedcontrols module loading, whilekwargs.trustedremains a constructor argument.Configurations and imported code must still be trusted. This is not a sandbox or directory-containment policy, and module-import consent does not enable unrestricted expressions or authorize artifact deserialization. Artifact-loading changes are handled separately in #2339.
See the configuration execution migration guide for supported syntax, custom extensions, and old-model recovery.