T09 · Insecure Skill Coding Practices
- Location
scripts/avavox_call.py:431- Finding
Explicit Task Configuration Is Silently Overwritten by Stored Defaults
- Content
View full analysis
Vulnerability Details
File Location:
scripts/avavox_call.py, lines 431–450
Vulnerability Type: Improper configuration precedence
Risk Level: MediumVulnerable Code
python assign_if_non_empty(body, "taskName", args.task_name) assign_if_non_empty(body, "robotId", args.robot_id) assign_if_non_empty(body, "lineId", args.line_id) assign_if_non_empty(body, "backgroundAudio", args.background_audio) concurrency = parse_optional_integer("concurrency", args.concurrency) if concurrency is not None: body["concurrency"] = concurrency assign_if_non_empty(body, "callTimeType", args.call_time_type) if runtime_config is not None: body["runtimeConfig"] = runtime_config if forbidden_call_time is not None: body["forbiddenCallTime"] = forbidden_call_time if scheduled_time is not None: body["scheduledTime"] = scheduled_time if mode == "create": assign_if_non_empty(body, "lineId", defaults.get("lineId")) assign_if_non_empty(body, "backgroundAudio", defaults.get("backgroundAudio")) assign_if_non_empty(body, "callTimeType", defaults.get("callTimeType"))Technical Analysis
assign_if_non_empty()assigns every non-empty value without checking whether the destination key is already present. During task creation, explicit values supplied through command-line arguments or the base JSON body are written first. The creation branch then applies non-empty defaults to the same keys, overwriting the explicit values.The affected fields are:
lineIdbackgroundAudiocallTimeType
This reverses the expected configuration precedence. Defaults should serve only as fallbacks, while explicit user input should have priority.
The
concurrencyfield is not affected because its default is applied only when"concurrency" not in body.Attack Path
- A non-empty value is placed in
defaults.lineId,defaults.backgroundAudio, ordefaults.callTimeTypethroughconfig.jsonor a supported environment variable. - A use ...[truncated 1455 chars]
- Remediation
View remediation
Remediation Suggestions
Apply defaults only when the corresponding field has not already been supplied:
python if mode == "create": if "lineId" not in body: assign_if_non_empty(body, "lineId", defaults.get("lineId")) if "backgroundAudio" not in body: assign_if_non_empty( body, "backgroundAudio", defaults.get("backgroundAudio"), ) if "callTimeType" not in body: assign_if_non_empty( body, "callTimeType", defaults.get("callTimeType"), ) if "concurrency" not in body and defaults.get("concurrency") is not None: body["concurrency"] = parse_optional_integer( "defaults.concurrency", str(defaults["concurrency"]), )Define and enforce a consistent precedence order, preferably:
- Explicit command-line arguments.
- Explicit body JSON, according to the documented merge policy.
- Environment or configuration defaults.
Add automated tests covering:
- Explicit CLI values overriding defaults.
- Explicit body values overriding defaults.
- Defaults being used only when fields are absent.
- Immediate and scheduled calling modes.
- Conflicting values across CLI arguments, body JSON, environment variables, and
config.json. - Verification of the final payload before the network request is sent.
For high-impact outbound actions, consider displaying the final resolved line and calling schedule for confirmation before task creation.
