A preview of this full-text is provided by Trans Tech Publications Ltd.
Content available from Applied Mechanics and Materials
This content is subject to copyright. Terms and conditions apply.
A Comparison of Sandbox Technologies Used in Online Judge Systems
Chao Yi
1, a
, Su Feng
1, b
, Zhi Gong
1, c
1College of Information Science and Technology, Beijing Normal University, 100875, Beijing, China
ayichao@mail.bnu.edu.cn, bfengsu@bnu.edu.cn, cgz@mail.bnu.edu.cn
Keywords: Online Judge; sandbox; system security.
Abstract. In this paper, the security issues in online judge systems (OJ) will be discussed. The pros
and cons in different sandbox approaches in open source OJs will be analyzed. After that, we’ll
explore other possibilities to build a more suitable sandbox for online judge purpose.
Introduction
As we know, online judge systems (OJ) are now getting more and more attention in modern
education, especially in programming related subjects like Data Structure and Algorithm. Teachers
tend to publish on the system more than traditional handouts because the system can give results much
quicker and more accurate.
At first, online judge systems are designed for programming contests like ACM/ICPC and OI
(Olympiad of Informatics). Universidad de Valladolid implements the first public Online Judge
System “UVa Online Judge” in 1997 [1]. In 2001, how to apply OJ to the Computer Science
education was discussed [2][3].
A typical online judge system contains three modules: Web, Judger and Database. Users submit
their source codes in the Web module and will be stored in database. Then Judger module will read
the details from the database. After compiling and running those codes, the Judger module will write
the verdict back to database for users to see.
Security issues were raised [2] since the judger module must run the programs users submit, which
might lead to serious problems like stealing passwords, formatting disk drives and so on. Fortunately,
now almost every OJ will check users’ submits and prevent executing dangerous code. The core
technology of these security methods is known as “Sandbox”.
In this paper, we’ll take some of the open-source online judge systems, analyze the sandbox
technologies they use and discuss the advantages and disadvantages separately.
Sandbox Technologies
Sandbox is a security mechanism for separating running programs, often used to execute untrusted
source code. Sandbox is a specific example of virtualization provides a controlled set of resources to
run on. In this section we’ll introduce the sandboxing technologies used in current OJs.
A. Linux
Linux provides lots of utilities focus on security issues for developers to choose from. Since Linux
is open-source, developers are able to built kernel-level sandboxes if they want. Here we list three
sandbox technologies widely used in current OJs.
1) ptrace
Ptrace is the most common one among open source OJs. BNUOJ, HUSTOJ, HITOJ and some
others are using ptrace to build their sandbox. The basic idea is described as follows:
First, fork a process to execute the guest program. Then use ptrace to flag the process itself as
traceable. Use setrlimit to set the basic limits, such as time, memory usage and file size. Load the
pre-defined blacklist (or white-list if you prefer) in the parent process, then trace every system call that
guest program makes.
Applied Mechanics and Materials Online: 2014-01-28
ISSN: 1662-7482, Vols. 490-491, pp 1201-1204
doi:10.4028/www.scientific.net/AMM.490-491.1201
© 2014 Trans Tech Publications Ltd, All Rights Reserved
All rights reserved. No part of contents of this paper may be reproduced or transmitted in any form or by any means without the written permission of Trans
Tech Publications Ltd, www.scientific.net. (Research Gate for subscription journals-28/02/25,02:58:13)