T09 · Insecure Skill Coding Practices
- Location
scripts/video_lips_change.js:78- Finding
Unrestricted JSON Fields Are Transmitted to the External WeryAI API
- Content
View full analysis
Vulnerability Details
File Location:
scripts/video_lips_change.js, lines 78-81 and 260-261
Vulnerability Type: Excessive data transmission caused by missing input allowlisting
Risk Level: MediumVulnerable Code
javascript function buildPayload(spec, input) { const payload = { ...spec.defaults, ...(input || {}) }; if (typeof spec.preparePayload === "function") spec.preparePayload(payload); if (payload.rect_vo_list != null) payload.rect_vo_list = normalizeRectList(payload.rect_vo_list); return payload; }javascript async function submitTool(spec, payload, apiKey) { const res = await httpJson("POST", BASE_URL + spec.endpoint, payload, apiKey);Technical Analysis
The documented interface accepts only
video_urlandaudio_url, butbuildPayloadcopies every property from the parsed--jsonobject into the outbound payload. Validation verifies that required fields exist and validates known URL fields, but it does not reject or remove unknown properties.The resulting payload is serialized in full and sent to the fixed external endpoint at
https://api.weryai.com. Consequently, arbitrary additional fields—including credentials, tokens, personal data, internal identifiers, or prompt-derived confidential content—can be transmitted despite being outside the declared data requirements of the skill.Sending the API key to the fixed WeryAI endpoint is necessary for the declared functionality. The security issue is the lack of minimization for the request body, which exceeds the documented input scope.
Attack Path
- An attacker, user, or upstream agent constructs a JSON argument containing the required URLs and an additional sensitive field:
json { "video_url": "https://example.com/video.mp4", "audio_url": "https://example.com/audio.mp3", "secret": "sensitive-value" } parseJsonInputparses the object without ap ...[truncated 706 chars]
- An attacker, user, or upstream agent constructs a JSON argument containing the required URLs and an additional sensitive field:
- Remediation
View remediation
Remediation Suggestions
Construct the outbound request from an explicit allowlist rather than copying the complete input object:
javascript function buildPayload(spec, input = {}) { return { video_url: input.video_url, audio_url: input.audio_url, }; }Additionally:
- Reject unknown keys and return a validation error identifying them.
- Define a strict JSON schema with
additionalProperties: false. - Keep dry-run previews, but ensure they display only the allowlisted payload.
- Add tests proving that fields such as
api_key,token,password, and arbitrary nested objects are rejected and never reachfetch. - Document precisely which fields are transmitted to WeryAI and avoid logging request bodies that may contain media URLs or credentials.
