Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Security: Implement RestrictedPython for safer custom code execution

Open
#235 0 comments 2 reactions 1 assignee View on GitHub

@aaronsteers is already working on this.

Since Jan 21, 2025.

Assessment

This issue has not been assessed yet.

Description

Background

Currently, the custom code compiler uses raw exec() to execute user-provided Python code, which could potentially be unsafe as it has unrestricted access to Python builtins and the global namespace.

Proposed Solution

Implement RestrictedPython to provide a safer execution environment for custom code. This will:

  1. Restrict access to potentially dangerous builtins
  2. Run code in an isolated namespace
  3. Prevent access to sensitive operations

References

Implementation Notes

  • Add RestrictedPython as a dependency
  • Replace current exec() implementation with RestrictedPython's secure execution
  • Add tests to verify security restrictions are working as expected

Security Considerations

This enhancement will improve the security posture of the custom code execution feature by preventing potentially malicious code from accessing sensitive operations or resources.

Dominant language
Python
Stars
26
Forks
53
Avg merge
7d 2h
Merged PRs (30d)
7

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from airbytehq/airbyte-python-cdk

All issues in airbytehq/airbyte-python-cdk

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.