Merge commit from fork
none of our endpoints will ever contain `..` (they might, maybe, at some point, contain `.`, as in `something/get.html`?), so every `Mk:api()` call to an endpoint that contains `..` can't work: let's reject it outright Co-authored-by: dakkar <dakkar@thenautilus.net>
This commit is contained in:
parent
2cd3fbf1a3
commit
583df3ec63
|
@ -68,7 +68,7 @@ export function createAiScriptEnv(opts: { storageKey: string, token?: string })
|
||||||
}),
|
}),
|
||||||
'Mk:api': values.FN_NATIVE(async ([ep, param, token]) => {
|
'Mk:api': values.FN_NATIVE(async ([ep, param, token]) => {
|
||||||
utils.assertString(ep);
|
utils.assertString(ep);
|
||||||
if (ep.value.includes('://')) {
|
if (ep.value.includes('://') || ep.value.includes('..')) {
|
||||||
throw new errors.AiScriptRuntimeError('invalid endpoint');
|
throw new errors.AiScriptRuntimeError('invalid endpoint');
|
||||||
}
|
}
|
||||||
if (token) {
|
if (token) {
|
||||||
|
|
Loading…
Reference in New Issue