Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #106572
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | Random832 <random832@fastmail.com> |
| Newsgroups | comp.lang.python |
| Subject | Re: Untrusted code execution |
| Date | Wed, 06 Apr 2016 09:14:56 -0400 |
| Lines | 36 |
| Message-ID | <mailman.129.1459948499.32530.python-list@python.org> (permalink) |
| References | <slrnng31v9.19u.jon+usenet@wintry.unequivocal.co.uk> <slrnng7gj4.19u.jon+usenet@wintry.unequivocal.co.uk> <58de161a-ecdb-4ada-aab5-871876ea1574@googlegroups.com> <slrnng7tgu.19u.jon+usenet@wintry.unequivocal.co.uk> <CAPTjJmrHWFHY5CdUBj_GYRCgnAWjAJ0mvtTj0_wC8O8rfzwZFA@mail.gmail.com> <mailman.84.1459878492.32530.python-list@python.org> <570469d7$0$1598$c3e8da3$5496439d@news.astraweb.com> <1459948496.786520.570667177.4C7E8044@webmail.messagingengine.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain |
| Content-Transfer-Encoding | 7bit |
| X-Trace | news.uni-berlin.de HfrpabsAP9xP3iaHMqq0kQaaOaIaLLcezYWpitzn2Zdw== |
| Return-Path | <random832@fastmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.000 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'resulting': 0.04; 'sys': 0.05; 'subject:code': 0.07; 'loaded,': 0.09; 'name)': 0.09; 'received:internal': 0.09; 'def': 0.13; 'argument': 0.15; 'interpreter': 0.15; 'forbid': 0.16; "guido's": 0.16; 'len': 0.16; 'message-id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:io': 0.16; 'received:messagingengine.com': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'try:': 0.18; 'usability': 0.18; '(in': 0.18; 'language': 0.19; 'load': 0.20; 'library': 0.20; 'features,': 0.22; 'keyerror:': 0.22; 'import': 0.24; 'header:In- Reply-To:1': 0.24; 'module': 0.25; 'module.': 0.27; 'code"': 0.29; 'str': 0.29; 'raise': 0.29; 'print': 0.30; 'especially': 0.32; "d'aprano": 0.33; 'int': 0.33; 'steven': 0.33; 'tue,': 0.34; 'except': 0.34; 'could': 0.35; 'too': 0.36; 'modules': 0.36; 'skip:{ 10': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'received:66': 0.38; 'skip:p 20': 0.38; 'to:addr:python.org': 0.40; 'header:Message-Id:1': 0.61; 'real': 0.62; 'useful.': 0.72; '"best': 0.84; 'reducing': 0.93 |
| DKIM-Signature | v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=unlNkGleryJuvZd2bfaH9paATHo=; b=ivQqEO JWB9KJjQFwyNzS218EgmAxTueIeT2H8kY06DWsAotHVuxC6fvswkMUaqHlOvmJUN q0E/dnI+gcNx9liF2NgwJ3D0IWyigGsSQB/zF1wt46+3Gcl41lfgdy3gsNXmEa+L tvGNEdfPGVGM9ewMsrc0jeCX5fExklc5fE4ws= |
| DKIM-Signature | v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=unlNkGleryJuvZd 2bfaH9paATHo=; b=KFicFaUNOhhgXBujolt61hXpCj3fDmv9SgTRO9ZKZwg/ykz uzeprkA4jDdSvpk9vRvm2x3k9Mnx2f1heKHy3CpnyZmOEVK5NF49dzypvrLMUbGe JCrqsKrS5D+dclf2qvIbQ6OHsu63mUNSn1XUoJcCyBkPyTCErPSHaN2bz+xY= |
| X-Sasl-Enc | ry1Wkh4I8SDHS1JJNZajKZx8vyisUaDkkCAO/OMpX//e 1459948496 |
| X-Mailer | MessagingEngine.com Webmail Interface - ajax-6aa5290f |
| In-Reply-To | <570469d7$0$1598$c3e8da3$5496439d@news.astraweb.com> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.21 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| X-Mailman-Original-Message-ID | <1459948496.786520.570667177.4C7E8044@webmail.messagingengine.com> |
| X-Mailman-Original-References | <slrnng31v9.19u.jon+usenet@wintry.unequivocal.co.uk> <slrnng7gj4.19u.jon+usenet@wintry.unequivocal.co.uk> <58de161a-ecdb-4ada-aab5-871876ea1574@googlegroups.com> <slrnng7tgu.19u.jon+usenet@wintry.unequivocal.co.uk> <CAPTjJmrHWFHY5CdUBj_GYRCgnAWjAJ0mvtTj0_wC8O8rfzwZFA@mail.gmail.com> <mailman.84.1459878492.32530.python-list@python.org> <570469d7$0$1598$c3e8da3$5496439d@news.astraweb.com> |
| Xref | csiph.com comp.lang.python:106572 |
Show key headers only | View raw
On Tue, Apr 5, 2016, at 21:43, Steven D'Aprano wrote:
> As Zooko says, Guido's "best argument is that reducing usability (in
> terms
> of forbidding language features, especially module import) and reducing
> the
> usefulness of extant library code" would make the resulting interpreter
> too
> feeble to be useful.
You don't have to forbid module import. The sandbox could control what
modules can be loaded, and what happens when you try to load a module.
import sys
module = type(sys)
fm = {}
def fimp(name, *etc):
# In a real implementation, this could also load whitelisted modules
try:
return fm[name]
except KeyError:
raise ImportError("Tried to load restricted module " + name)
fm['builtins'] = fb = module('builtins')
fb.int = int
fb.str = str
fb.len = len
fb.print = print
fb.__import__ = fimp
fm['sys'] = fsys = module('sys')
fsys.modules = fm
exec("""
import sys
print(sys.modules.keys())
""", {'__builtins__': fb})
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Untrusted code execution Jon Ribbens <jon+usenet@unequivocal.co.uk> - 2016-04-03 21:12 +0000
Re: Untrusted code execution Jon Ribbens <jon+usenet@unequivocal.co.uk> - 2016-04-05 13:46 +0000
Re: Untrusted code execution Rustom Mody <rustompmody@gmail.com> - 2016-04-05 07:17 -0700
Re: Untrusted code execution Ian Kelly <ian.g.kelly@gmail.com> - 2016-04-05 08:50 -0600
Re: Untrusted code execution Jon Ribbens <jon+usenet@unequivocal.co.uk> - 2016-04-05 17:26 +0000
Re: Untrusted code execution Jon Ribbens <jon+usenet@unequivocal.co.uk> - 2016-04-05 18:50 +0000
Re: Untrusted code execution Jon Ribbens <jon+usenet@unequivocal.co.uk> - 2016-04-05 19:14 +0000
Re: Untrusted code execution Jon Ribbens <jon+usenet@unequivocal.co.uk> - 2016-04-05 19:13 +0000
Re: Untrusted code execution Steven D'Aprano <steve@pearwood.info> - 2016-04-06 11:43 +1000
Re: Untrusted code execution Random832 <random832@fastmail.com> - 2016-04-06 09:14 -0400
Re: Untrusted code execution Steven D'Aprano <steve@pearwood.info> - 2016-04-07 11:45 +1000
Re: Untrusted code execution Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2016-04-07 14:48 +1000
Re: Untrusted code execution Jon Ribbens <jon+usenet@unequivocal.co.uk> - 2016-04-07 15:18 +0000
Re: Untrusted code execution Steven D'Aprano <steve@pearwood.info> - 2016-04-08 15:28 +1000
Re: Untrusted code execution Jon Ribbens <jon+usenet@unequivocal.co.uk> - 2016-04-07 12:13 +0000
Re: Untrusted code execution Jon Ribbens <jon+usenet@unequivocal.co.uk> - 2016-04-07 14:25 +0000
Re: Untrusted code execution Steven D'Aprano <steve@pearwood.info> - 2016-04-08 15:26 +1000
Re: Untrusted code execution Jon Ribbens <jon+usenet@unequivocal.co.uk> - 2016-04-07 17:20 +0000
Re: Untrusted code execution Jon Ribbens <jon+usenet@unequivocal.co.uk> - 2016-04-07 17:35 +0000
Re: Untrusted code execution Jon Ribbens <jon+usenet@unequivocal.co.uk> - 2016-04-10 17:06 +0000
Re: Untrusted code execution Jon Ribbens <jon+usenet@unequivocal.co.uk> - 2016-04-05 17:40 +0000
Re: Untrusted code execution Paul Rubin <no.email@nospam.invalid> - 2016-04-05 13:39 -0700
Re: Untrusted code execution Jon Ribbens <jon+usenet@unequivocal.co.uk> - 2016-04-05 21:13 +0000
Re: Untrusted code execution Paul Rubin <no.email@nospam.invalid> - 2016-04-07 00:08 -0700
Re: Untrusted code execution Lele Gaifax <lele@metapensiero.it> - 2016-04-08 10:10 +0200
csiph-web