T09 · Insecure Skill Coding Practices
- Location
src/api/comment.js:17- Finding
API Credential Transmitted in URL Query Parameters
- Content
View full analysis
{ return await postJson( "/api/xiaohongshu/comment/url", { _: Date.now(), token: token }, { url, limit }, ); }, constants.CREATE_MAX_ATTEMPTS, (attempt, err) => { utils.printError( `【创建任务重试】 ${attempt + 1}/${constants.CREATE_MAX_ATTEMPTS} 次 - ${err.message}`, ); }, ); } ``` ```js // src/api/comment.js:43-51 async function getCommentTask(token, url, limit) { return await withRetry( async () => { const res = await getJson("/api/xiaohongshu/comment/info", { _: Date.now(), token: token, url, limit, }); return res.data; ``` ```js // src/utils/request.js:76-98 async function postJson(path, params, data) { if (!path || typeof path !== "string") { throw new Error("path 必须是非空字符串"); } if (!params || typeof params !== "object") { throw new Error("params 必须是对象"); } if (!data || typeof data !== "object") { throw new Error("data 必须是对象"); } params.skill_name = skillName(); const fullPath = `${path}?${querystring.stringify(params)}`; const jsonData = JSON.stringify(data); const options = { host: constants.BASE_URL, path: fullPath, method: "POST", headers: { "Content-Type": "application/json", "Content-Length": Buffer.byteLength(jsonData), }, }; return await request(options, jsonData); } ``` ```js // src/utils/request.js:101-119 async function getJson(path, params) { if (!path || typeof path !== "string") { throw n ...[truncated 2813 chars]- Remediation
View remediation
