Commit 43f4dc0
[INFRA-779] delegate isValidURL to the shared isValidNextPath instead of a local reimplementation
Address /code-review findings on the plane-ee port (PR #9286), which
apply equally here: the from-scratch location.origin-based check had its
own gap — a next_path like "http:evil.com" resolves AS IF relative
whenever the input's scheme happens to match the real origin's own
scheme. On this repo's real fix that meant any self-hosted deployment
actually serving over plain http (not just the EE port's hardcoded-http
placeholder-base variant) — verified directly: bypasses the check on an
http:// origin, though not on https://, since the schemes then differ.
isValidNextPath (@plane/utils, already used by apps/space for this
identical purpose) closes this by requiring a literal leading "/" (and
rejecting "//") before any URL-based comparison, so it doesn't depend on
which scheme the real origin happens to use. Also removes a second,
independently-bug-prone implementation of the same check.
Co-authored-by: Plane AI <noreply@plane.so>1 parent 1241037 commit 43f4dc0
1 file changed
Lines changed: 14 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
0 commit comments