cauthy-auth 0.35.2 → 0.36.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1095,6 +1095,12 @@ function random(bytes = 32) {
1095
1095
  }
1096
1096
  function localPath(candidate, fallback) {
1097
1097
  if (!candidate || !candidate.startsWith("/") || candidate.startsWith("//") || candidate.includes("\\")) return fallback;
1098
+ if (/[\u0000-\u001f\u007f]/.test(candidate)) return fallback;
1099
+ try {
1100
+ if (new URL(candidate, "http://x").origin !== "http://x") return fallback;
1101
+ } catch {
1102
+ return fallback;
1103
+ }
1098
1104
  return candidate;
1099
1105
  }
1100
1106
  function json(body, status = 200, headers) {