GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — codeql/python/ql/src/Expressions/UseofInput.qhelp at codeql-cli/v2.19.1 · github/codeql Expand file tree/ Copy pathUseofInput.qhelpMore file actions 23 lines (17 loc) · 910 Bytes / Copy pathUseofInput.qhelpFile metadata and controls23 lines (17 loc) · 910 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 <!DOCTYPE qhelp PUBLIC "-//Semmle//qhelp//EN" "qhelp.dtd"> <qhelp> <overview> <p>In Python 2, a call to the <code>input()</code> function, <code>input(prompt)</code> is equivalent to <code>eval(raw_input(prompt))</code>. Evaluating user input without any checking can be a serious security flaw.</p> </overview> <recommendation> <p>Get user input with <code>raw_input(prompt)</code> and then validate that input before evaluating. If the expected input is a number or string, then <code>ast.literal_eval()</code> can always be used safely.</p> </recommendation> <references> <li>Python Standard Library: <a href="http://docs.python.org/2/library/functions.html#input">input</a>, <a href="http://docs.python.org/2/library/ast.html#ast.literal_eval">ast.literal_eval</a>.</li> <li>Wikipedia: <a href="http://en.wikipedia.org/wiki/Data_validation">Data validation</a>.</li> </references> </qhelp> |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |