/library/nusoap/0001-Fix-12312-NuSOAP-web-description-XSS-vulnerability.patch

https://github.com/fusenigk/mantisbt-1 · Patch · 119 lines · 112 code · 7 blank · 0 comment · 0 complexity · d639190a9af09a00523157562b0ac27b MD5 · raw file

  1. From edb817991b99cd5538f102be26865fde7c6b7212 Mon Sep 17 00:00:00 2001
  2. From: David Hicks <hickseydr@optusnet.com.au>
  3. Date: Thu, 2 Sep 2010 21:51:21 +1000
  4. Subject: [PATCH] Fix #12312: NuSOAP web description XSS vulnerability
  5. Bogdan Calin from Acunetix discovered a number of XSS vulnerabilities in
  6. NuSOAP 0.9.5 (bundled with MantisBT) relating to improperly escaped
  7. URLs.
  8. A sample exploit URL is:
  9. /api/soap/mantisconnect.php?1<ScRiPt>prompt(923395)</ScRiPt>
  10. The upstream report for these XSS flaws in NuSOAP is located at the
  11. following URL:
  12. http://sourceforge.net/projects/nusoap/forums/forum/193579/topic/3834005
  13. This patch provides an interim fix for MantisBT users until upstream
  14. makes a new release.
  15. ---
  16. library/nusoap/class.wsdl.php | 16 ++++++++--------
  17. library/nusoap/nusoap.php | 14 +++++++-------
  18. 2 files changed, 15 insertions(+), 15 deletions(-)
  19. diff --git a/library/nusoap/class.wsdl.php b/library/nusoap/class.wsdl.php
  20. index 6d2a693..7dcc307 100644
  21. --- a/library/nusoap/class.wsdl.php
  22. +++ b/library/nusoap/class.wsdl.php
  23. @@ -842,9 +842,9 @@ class wsdl extends nusoap_base {
  24. <body>
  25. <div class=content>
  26. <br><br>
  27. - <div class=title>'.$this->serviceName.'</div>
  28. + <div class=title>'.htmlentities($this->serviceName).'</div>
  29. <div class=nav>
  30. - <p>View the <a href="'.$PHP_SELF.'?wsdl">WSDL</a> for the service.
  31. + <p>View the <a href="'.htmlentities($PHP_SELF).'?wsdl">WSDL</a> for the service.
  32. Click on an operation name to view it&apos;s details.</p>
  33. <ul>';
  34. foreach($this->getOperations() as $op => $data){
  35. @@ -854,21 +854,21 @@ class wsdl extends nusoap_base {
  36. <a href='#' onclick='popout()'><font color='#ffffff'>Close</font></a><br><br>";
  37. foreach($data as $donnie => $marie){ // loop through opdata
  38. if($donnie == 'input' || $donnie == 'output'){ // show input/output data
  39. - $b .= "<font color='white'>".ucfirst($donnie).':</font><br>';
  40. + $b .= "<font color='white'>".htmlentities(ucfirst($donnie)).':</font><br>';
  41. foreach($marie as $captain => $tenille){ // loop through data
  42. if($captain == 'parts'){ // loop thru parts
  43. - $b .= "&nbsp;&nbsp;$captain:<br>";
  44. + $b .= "&nbsp;&nbsp;".htmlentities($captain).":<br>";
  45. //if(is_array($tenille)){
  46. foreach($tenille as $joanie => $chachi){
  47. - $b .= "&nbsp;&nbsp;&nbsp;&nbsp;$joanie: $chachi<br>";
  48. + $b .= "&nbsp;&nbsp;&nbsp;&nbsp;".htmlentities($joanie).": ".htmlentities($chachi)."<br>";
  49. }
  50. //}
  51. } else {
  52. - $b .= "&nbsp;&nbsp;$captain: $tenille<br>";
  53. + $b .= "&nbsp;&nbsp;".htmlentities($captain).": ".htmlentities($tenille)."<br>";
  54. }
  55. }
  56. } else {
  57. - $b .= "<font color='white'>".ucfirst($donnie).":</font> $marie<br>";
  58. + $b .= "<font color='white'>".htmlentities(ucfirst($donnie)).":</font> ".htmlentities($marie)."<br>";
  59. }
  60. }
  61. $b .= '</div>';
  62. @@ -1935,4 +1935,4 @@ class wsdl extends nusoap_base {
  63. }
  64. }
  65. -?>
  66. \ No newline at end of file
  67. +?>
  68. diff --git a/library/nusoap/nusoap.php b/library/nusoap/nusoap.php
  69. index 4973532..10750aa 100644
  70. --- a/library/nusoap/nusoap.php
  71. +++ b/library/nusoap/nusoap.php
  72. @@ -5424,9 +5424,9 @@ class wsdl extends nusoap_base {
  73. <body>
  74. <div class=content>
  75. <br><br>
  76. - <div class=title>'.$this->serviceName.'</div>
  77. + <div class=title>'.htmlentities($this->serviceName).'</div>
  78. <div class=nav>
  79. - <p>View the <a href="'.$PHP_SELF.'?wsdl">WSDL</a> for the service.
  80. + <p>View the <a href="'.htmlentities($PHP_SELF).'?wsdl">WSDL</a> for the service.
  81. Click on an operation name to view it&apos;s details.</p>
  82. <ul>';
  83. foreach($this->getOperations() as $op => $data){
  84. @@ -5436,21 +5436,21 @@ class wsdl extends nusoap_base {
  85. <a href='#' onclick='popout()'><font color='#ffffff'>Close</font></a><br><br>";
  86. foreach($data as $donnie => $marie){ // loop through opdata
  87. if($donnie == 'input' || $donnie == 'output'){ // show input/output data
  88. - $b .= "<font color='white'>".ucfirst($donnie).':</font><br>';
  89. + $b .= "<font color='white'>".htmlentities(ucfirst($donnie)).':</font><br>';
  90. foreach($marie as $captain => $tenille){ // loop through data
  91. if($captain == 'parts'){ // loop thru parts
  92. - $b .= "&nbsp;&nbsp;$captain:<br>";
  93. + $b .= "&nbsp;&nbsp;".htmlentities($captain).":<br>";
  94. //if(is_array($tenille)){
  95. foreach($tenille as $joanie => $chachi){
  96. - $b .= "&nbsp;&nbsp;&nbsp;&nbsp;$joanie: $chachi<br>";
  97. + $b .= "&nbsp;&nbsp;&nbsp;&nbsp;".htmlentities($joanie).": ".htmlentities($chachi)."<br>";
  98. }
  99. //}
  100. } else {
  101. - $b .= "&nbsp;&nbsp;$captain: $tenille<br>";
  102. + $b .= "&nbsp;&nbsp;".htmlentities($captain).": ".htmlentities($tenille)."<br>";
  103. }
  104. }
  105. } else {
  106. - $b .= "<font color='white'>".ucfirst($donnie).":</font> $marie<br>";
  107. + $b .= "<font color='white'>".htmlentities(ucfirst($donnie)).":</font> ".htmlentities($marie)."<br>";
  108. }
  109. }
  110. $b .= '</div>';
  111. --
  112. 1.7.2.2