|
|||||||||||
|
RE: Input validation
From: Dawes, Rogan (ZA - Johannesburg) <rdawes(at)deloitte.co.za>
Date: Fri Jun 20 2003 - 03:10:41 EDT
The idea is that you make sure to appropriately "escape" all data crossing boundaries between systems. For example, when formulating a SQL query based on data received from the browser, make sure to escape any quote characters. When writing data out to the browser, make sure to escape any angle brackets as HTML entities. When writing data out to an XML stream, make sure to escape any angle brackets, ampersands. When writing out data to an error log, make sure to escape any embedded carriage returns, or other control characters, spaces, etc that could cause problems when automatically parsing the file (or even manually reading it c.f. xterm escape codes). That way, you can still operate with the "malformed" data, and have audit trails that show what was really submitted. You can always decide not to continue processing, but the data will remain just that - data - and not cross the line into "metadata" (HTML code, line separators, SQL injections, XSS, etc) This can have a downside in terms of performance, but in terms of correctness, I think it is a better approach. So, if as a different poster asked, you need to allow some tags, and disallow others, your HTML output quoting function would need to implement selective quoting (preferably from a white-list, with specific allowed tag-attributes, with the tag attributes appropriately quoted, etc. Rogan > -----Original Message-----
Important Notice: This email is subject to important restrictions, qualifications and disclaimers ("the Disclaimer") that must be accessed and read by clicking here or by copying and pasting the following address into your Internet browser's address bar: http://www.Deloitte.co.za/Disc.htm. The Disclaimer is deemed to form part of the content of this email in terms of Section 11 of the Electronic Communications and Transactions Act, 25 of 2002. If you cannot access the Disclaimer, please obtain a copy thereof from us by sending an email to ClientServiceCentre(at)Deloitte.co.za. Received on Fri Jun 20 08:40:03 2003 This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:07:52 EDT |
||||||||||
|
|||||||||||