Featured post
php - Prevent application from introducing harmful changes on the server side -
this small little hobby project in php. use 0sites.org server (linux os). try imitate functionalities of http://www.codepad.org, http://www.ideone.com. trying have online compiler/interpreter lanuages.
as of now, can compile/run applications php exec(..)
, unsure how going filter out harmful function calls c/c++ system(..)
. also, have little idea how going prevent network access.
i planning add few more languages. difficult implement things specific every language. wondering if there way stop things @ more general level.
i have thought on lines of parsing code manually , comment out problematic lines of code. since there more 1 way things, can broken. :-p
any ideas/suggestions/pointers ? shall highly grateful same. :-)
(ps: hobby project. want make professional possible.. )
you need os support creating these sandboxes. approach involving filtering source code going have security problems, , nightmare maintain.
just think: if implement parser correctly, there bug in php's parser, parses differently. allow run system, exec, etc. , around filtering.
you have not stumbled across hobby project; have stumbled across research project.
edit 1
the sanest way can think of without os support patch php (but you'd working in c then, not php), or re-implement php in php. keep in mind how crazy is. sure know countless libraries linked in may do, when given funny arguments? e.g., may want disallow writing files, allow mysql. except mysql has sql commands write arbitrary files.
http://codepad.org/about says done os support. maybe can make ptrace
module php, , implement yours in similar way.
- Get link
- X
- Other Apps
Comments
Post a Comment