Skip to content

Commit

Permalink
Escape error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Aug 16, 2017
1 parent 62473e4 commit c179c9c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ Web change log

## ?.?.? / ????-??-??

## 0.6.3 / 2017-08-16

* Prevented possible security problems by escaping error messages
(@thekid)

## 0.6.2 / 2017-07-07

* Added support for prefork mode; use `-m prefork[,n]` on command line
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/web/error.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h1>
<span id="message">%2$s</span>
</h1>
<p id="detail">%3$s</p>
<xmp id="trace">%4$s</xmp>
<pre id="trace">%4$s</pre>
</div>
</body>
</html>
6 changes: 3 additions & 3 deletions src/main/php/xp/web/HttpProtocol.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ private function sendError($request, $response, $error) {
$response->send(sprintf(
$loader->getResource($variant),
$error->status(),
$message,
$error->getMessage(),
$error->toString()
htmlspecialchars($message),
htmlspecialchars($error->getMessage()),
htmlspecialchars($error->toString())
));
break;
}
Expand Down

0 comments on commit c179c9c

Please sign in to comment.