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 (#3074)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianb authored and jaredhirsch committed Jul 11, 2017
1 parent 36c6502 commit ecfaa64
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 ecfaa64

Please sign in to comment.