Lightweight Docker Based Secure Sandbox for Running Python Code

To Run untrusted Python code securely is a critical requirement for many modern platforms such as online IDEs, educational tools and cloud services. This paper presents a lightweight sandbox solution using Docker containers combined with a FastAPI interface to execute Python scripts safely in isolated environments. We discuss the system's design, implementation details and resource control mechanisms. Our evaluation shows that the sandbox effectively enforces strict network restrictions, resource limits and execution timeouts, preventing common security threats like unauthorized access, resource abuse and container escapes. While acknowledging some limitations, this approach provides a practical foundation for secure Python code execution in scalable interactive applications.

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2025-05-25
DOI
https://doi.org/10.5281/zenodo.15514254
Primary Topic
Security and Verification in Computing
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Lightweight Docker Based Secure Sandbox for Running Python Code

Zenodo (CERN European Organization for Nuclear Research)
Security and Verification in Computing
article

Lightweight Docker Based Secure Sandbox for Running Python Code

article en

Abstract

To Run untrusted Python code securely is a critical requirement for many modern platforms such as online IDEs, educational tools and cloud services. This paper presents a lightweight sandbox solution using Docker containers combined with a FastAPI interface to execute Python scripts safely in isolated environments. We discuss the system's design, implementation details and resource control mechanisms. Our evaluation shows that the sandbox effectively enforces strict network restrictions, resource limits and execution timeouts, preventing common security threats like unauthorized access, resource abuse and container escapes. While acknowledging some limitations, this approach provides a practical foundation for secure Python code execution in scalable interactive applications.

Zenodo (CERN European Organization for Nuclear Research)
Openalex Percentile: Top 75%
Security and Verification in Computing
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.