Skip to content

Commit

Permalink
More path traversal fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shamoon committed Jun 3, 2024
1 parent 7e50da8 commit 52b733b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pages/api/services/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default async function handler(req, res) {
if (!mapping.segments.includes(key)) {
logger.debug("Unsupported segment: %s", key);
return res.status(403).json({ error: "Unsupported segment" });
} else if (segments[key].includes("/")) {
} else if (segments[key].includes("/") || segments[key].includes("\\") || segments[key].includes("..")) {
logger.debug("Unsupported segment value: %s", segments[key]);
return res.status(403).json({ error: "Unsupported segment value" });
}
Expand Down

0 comments on commit 52b733b

Please sign in to comment.