#! /bin/sh /usr/share/dpatch/dpatch-run ## 13_possible_xss_vulnerability.dpatch by ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Fix a possible XSS vulnerability due to urldecoding after htmlentities. @DPATCH@ diff -urNad torrentflux~/html/dir.php torrentflux/html/dir.php --- torrentflux~/html/dir.php 2006-12-09 15:19:23.000000000 -0800 +++ torrentflux/html/dir.php 2006-12-09 15:20:30.000000000 -0800 @@ -258,7 +258,7 @@ if (!file_exists($cfg["path"].$dir)) { - echo "".$dir." could not be found or is not valid."; + echo "".htmlentities($dir)." could not be found or is not valid."; } else { diff -urNad torrentflux~/html/index.php torrentflux/html/index.php --- torrentflux~/html/index.php 2006-12-09 15:19:23.000000000 -0800 +++ torrentflux/html/index.php 2006-12-09 15:29:13.000000000 -0800 @@ -394,7 +394,7 @@ if (is_file($cfg["torrent_file_path"].$file_name)) { // Error - $messages .= "Error with (".$file_name."), the file already exists on the server.
[Refresh]
"; + $messages .= "Error with (".htmlentities($file_name)."), the file already exists on the server.
[Refresh]
"; $ext_msg = "DUPLICATE :: "; } else @@ -407,7 +407,7 @@ } else { - $messages .= "Error Getting the File (".$file_name."), Could be a Dead URL.
[Refresh]
"; + $messages .= "Error Getting the File (".htmlentities($file_name)."), Could be a Dead URL.
[Refresh]
"; } if ($messages == "") @@ -440,7 +440,7 @@ if (is_file($cfg["torrent_file_path"].$file_name)) { // Error - $messages .= "Error with (".$file_name."), the file already exists on the server.
[Refresh]
"; + $messages .= "Error with (".htmlentities($file_name)."), the file already exists on the server.
[Refresh]
"; $ext_msg = "DUPLICATE :: "; } else @@ -455,7 +455,7 @@ } else { - $messages .= "ERROR: File not uploaded, file could not be found or could not be moved:
".$cfg["torrent_file_path"] . $file_name."

"; + $messages .= "ERROR: File not uploaded, file could not be found or could not be moved:
".$cfg["torrent_file_path"] . htmlentities($file_name)."

"; } } }