Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Fix sandbox escape by disabling the preload parameter. #96

Merged
merged 11 commits into from
Oct 16, 2024

Conversation

hexian2001
Copy link
Contributor

What i modified:

  1. modified: conf/config.yaml

    • Added enable_preload configuration with a default value of False for security purposes.
  2. modified: internal/types/config.go

    • Updated the configuration structure to include the EnablePreload parameter.
  3. modified: internal/service/nodejs.go

    • Added logic to retrieve the EnablePreload setting from the configuration. If EnablePreload is disabled, the preload field is set to an empty string.
  4. modified: internal/service/python.go

    • Added logic to retrieve the EnablePreload setting from the configuration. If EnablePreload is disabled, the preload field is set to an empty string.

Summarize:

  1. After making the modifications and running compilation tests, the command injection attack has been successfully prevented.
  2. After discussing with the project maintainer, it was concluded that this parameter is theoretically deprecated. Therefore, it is disabled by default and will not be updated through environment variables. Currently, disabling the preload parameter does not negatively impact other functionalities.

@Yeuoly
Copy link
Collaborator

Yeuoly commented Oct 16, 2024

pls rebase to main branch as you could get passed by CI tests.

Copy link
Collaborator

@Yeuoly Yeuoly left a comment

Choose a reason for hiding this comment

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

LGTM

@Yeuoly Yeuoly merged commit 3a73859 into langgenius:main Oct 16, 2024
2 checks passed
@hexian2001 hexian2001 deleted the ban-preload-to-fix-sandbox-escape branch October 16, 2024 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants