Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email firstname.lastname@example.org
Re: [Full-Disclosure] [anti-XSS]about CERT/CC:malicious_code_mitigation
Date: Mon Aug 09 2004 - 23:17:40 CDT
On Mon, 09 Aug 2004 19:45:07 PDT, dd said:
> Real solution is to have "per input" input validation which will always
> let some "potentially bad" things through, but help mitigate exposures
> and then do things "right".
Actually, you should be doing "per input" validation on each field, which tries
to totally eliminate the "potentially bad" for each field, as appropriate for
the field in question - my example of alphanumeric, space, hyphen, and
underscore may not be suitable for all fields (as one clued person pointed out
to me in private mail). A real program will almost certainly end up with a
separate filter for each field type....
The *important* part is that you're *not* using 's/[list-of-known-bad]//g',
but that you use 's/[^list-of-known-good]//g'. Making the known-good list
for each field is the programmer's problem.
How many CGI scripts have had directory traversal issues that would have been
completely and totally prevented if they had done the filtering right and dropped
the '/' character (and probably '.' too) out? ;)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Exmh version 2.5 07/13/2001
-----END PGP SIGNATURE-----
Full-Disclosure - We believe in it.