¿QUIÉN DA CON EL PROBLEMA?

Iniciado por crimi, 14 Diciembre 2012, 19:26 PM

0 Miembros y 1 Visitante están viendo este tema.

crimi

Hola a tod@s:

Viendo los siguientes 2 fragmentos de código, ¿quién es capaz de identificar los posibles problemas o debilidades de seguridad y, si es posible, ofrecer una solución?:

1.

[...]
char *tmp_name;
int tmpfd;
tmp_name = "/tmp/tmpfile.XXXXX";
if( (tmpfd = open(tmp_name, O_RDWR | O_CREAT)) < 0) lnegra
exit(-1);
[...]
unlink(tmp_name);
/*
** remove the filename so that the file is not left on the
** file system when the program code completes or when
** the file descriptor is closed.
*/
[...]

2,
[...]
String comment = request.getParameter("comment");
//Validate input for quotes and SQL especific chars
[...]
// End of SQL validation and begin XSS validation
comment.replaceAll("<script>","");
comment.replaceAll("</script>","");
// Other cleanup operations
[...]