灰盒测试时如何验证Vue组件中的API调用是否安全?
我在做灰盒测试,手上有部分源码和访问权限,但不确定该怎么检查Vue组件里调用的后端接口有没有安全风险。比如下面这个组件直接把用户输入拼接到URL里发请求,会不会有漏洞?
<template>
<input v-model="userId" />
<button @click="fetchUser">查用户</button>
</template>
<script>
export default {
data() {
return { userId: '' }
},
methods: {
async fetchUser() {
const res = await fetch(/api/user/${this.userId});
// ...
}
}
}
</script>
我试过在userId里输入' OR '1'='1之类的字符串,但后端好像做了过滤。问题是:这种场景下,我该重点测什么?参数校验?路径遍历?还是别的?
暂无解答