node243





11.2.5 Caring about security

















Python Library Reference




Previous: 11.2.4 Functions
Up: 11.2 cgi
Next: 11.2.6 Installing your CGI




11.2.5 Caring about security



There's one important rule: if you invoke an external program (e.g.
via the os.system() or os.popen() functions),
make very sure you don't pass arbitrary strings received from the
client to the shell. This is a well-known security hole whereby
clever hackers anywhere on the web can exploit a gullible CGI script
to invoke arbitrary shell commands. Even parts of the URL or field
names cannot be trusted, since the request doesn't have to come from
your form!


To be on the safe side, if you must pass a string gotten from a form
to a shell command, you should make sure the string contains only
alphanumeric characters, dashes, underscores, and periods.








Python Library Reference




Previous: 11.2.4 Functions
Up: 11.2 cgi
Next: 11.2.6 Installing your CGI



See About this document... for information on suggesting changes.





Wyszukiwarka

Podobne podstrony:
node245 T2YQJZD6LDQ6LP5OYUC3OHQJMT5QYEUMQNSNPTI
node245
node242 7L22GLKYOY7WCD2ENRGH2MBHLMAUTJL2GTKKYNY
node246 YIF4WCYAY6SJS2OLKTPEMD6TGPZD4BLGOW43G3A
node24 PDHWHKXXAJCE53SGAZZQAGL4RLNJ7ZXWLGOY4QY
node24
node24 3ZDS5WHDJGYZQJTUOOHV6YJOOXTC2GUWSJC775I
node24
node244
node243 YS2T6SICTFF6CFMWRO7X5VPFRR7EJ4VCN3TKXFY
node24 2PNVCNM2PFRUZA3ENONWT4NSN4DPLHTMPZ3FH7Y
node241
node244 D3H4Q5QNKWCUAFHHJWADTRR7OS7G5JGYHSPAIMQ
node249 7JYBNHKY3DEZ42ROO3VGHKZUJVB2IRUD4MHHCUY
node247
node24 1
node248 C33U2NRXWJ5BBSGXFIODC6MPK44O246Y7WN2G7Y

więcej podobnych podstron