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

Fix #3073, validate URLs before redirect #3074

Merged
merged 1 commit into from
Jul 11, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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