Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Fix #3073, validate URLs before redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
ianb committed Jun 30, 2017
1 parent beac583 commit 16d1213
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,11 @@ app.post("/timing", function(req, res) {

app.get("/redirect", function(req, res) {
if (req.query.to) {
if (! validUrl.isWebUri(req.query.to)) {
mozlog.warn("redirect-to-bad-url", {msg: "?to is not a proper URL", url: req.query.to});
res.status(400).send("Bad ?to parameter");
return;
}
let from = req.query.from;
if (!from) {
from = "shot-detail";
Expand Down

0 comments on commit 16d1213

Please sign in to comment.