Commit fc1b37c
lsc
fix(security): validate presigned URL scheme before PUT / download
yujiawei's P1: `uploadMcpIconReal` and `uploadFile` used the backend-
returned `presigned_url` directly with no scheme/host check; likewise
`downloadSkill` assigned `result.url` to `anchor.href` without a scheme
check. A misconfigured or compromised marketplace could point the
browser at `javascript:`, `data:`, `file:`, or an internal-only host.
Both packages now gate every backend-supplied external URL through a
tiny checker that only accepts:
- `https://…` (production case), or
- `http://localhost` / `http://127.0.0.1` (dev proxy)
Everything else throws before the network call happens. Credential
leakage was already covered (raw axios / no interceptors on the PUT);
this closes the destination-side gap.
Refs: PR Mininglamp-OSS#851 review by @yujiawei1 parent e7c8c39 commit fc1b37c
2 files changed
Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
67 | 86 | | |
68 | 87 | | |
69 | 88 | | |
| |||
553 | 572 | | |
554 | 573 | | |
555 | 574 | | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
556 | 581 | | |
557 | 582 | | |
558 | 583 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
129 | 148 | | |
130 | 149 | | |
131 | 150 | | |
| |||
273 | 292 | | |
274 | 293 | | |
275 | 294 | | |
| 295 | + | |
276 | 296 | | |
277 | 297 | | |
278 | 298 | | |
| |||
298 | 318 | | |
299 | 319 | | |
300 | 320 | | |
| 321 | + | |
301 | 322 | | |
302 | 323 | | |
303 | 324 | | |
| |||
0 commit comments