T09 · Insecure Skill Coding Practices
- Location
scripts/headshots.sh:6- Finding
Unvalidated API Base Allows API-Key and Biometric-Image Disclosure
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This portrait-processing skill is mostly coherent, but it needs review because sensitive photos and API keys can be sent to an environment-selected server and some API-controlled filenames are not safely contained.
Review before installing. Use a least-privilege MCE_API_KEY, keep MCE_API_BASE unset or restricted to the official HTTPS service unless you intentionally use a separate trusted deployment with a separate key, and run outputs in a dedicated directory. Be especially cautious with passport, ID, and reusable headshot reference images until the scripts validate API origins and response-derived filenames.
scripts/headshots.sh:6Unvalidated API Base Allows API-Key and Biometric-Image Disclosure
scripts/id-pack.sh:57API-Controlled ID-Package Specifiers Permit Path Traversal and File Overwrite
scripts/headshots.sh:386API-Controlled Headshot Resource IDs Permit Path Traversal and Arbitrary File Writes
The code is clearly related to the general declared domain of AI headshots and portrait processing through the Motu API, so there is substantial overlap. It does support source inspection, skin-base and smoothing previewing, garment preference, candidate generation, rendering, lighting, and exporting cropped outputs. However, the declared description materially overstates the implemented functionality: there is no mask/matte export, no explicit background swap operation, no compliance checker for ID/passport rules beyond a generic eligibility/source check, no upload optimization, and no print-sheet layout feature. The code also includes person-reference library management capabilities that are not mentioned in the description. Because the description presents a broader multifunction portrait/ID-photo toolkit than the code actually implements, this is a description-behavior mismatch.
The code’s actual behavior is much narrower than the declared description. It only performs portrait lighting adjustment through a specific HTTP endpoint, with parameters for style and strength. While this is loosely adjacent to portrait retouching, the description claims many additional capabilities—mask export, clothing replacement, AI headshots, ID-photo production, background swap, compliance checks, and print layouts—that are not present in this code chunk. This is a material description-to-behavior mismatch because the declared purpose suggests a multifunction portrait/ID-photo suite, whereas the code implements only portrait lighting.
The declared description presents a broad image-editing and headshot-generation skill with many portrait and ID-photo transformation capabilities. The actual code chunk does not perform any image processing, retouching, masking, clothing replacement, cropping, compliance checking, upload optimization, or print-sheet generation. Instead, it only retrieves and displays available styles from the API. While style discovery could be tangentially supportive to a larger image-generation workflow, this chunk’s primary behavior is materially different from the declared purpose and represents an undeclared capability/utility endpoint.
Referenced artifact was not completely inspected
- Use `scripts/headshots.sh` when the user wants AI-generated professional, business, corporate, LinkedIn, or studio headshots. Keep reference preparation, conf
Referenced artifact was not completely inspected
- Use `scripts/headshots.sh` when the user wants AI-generated professional, business, corporate, LinkedIn, or studio headshots. Keep reference preparation, conf
Referenced artifact was not completely inspected
- Use `scripts/headshots.sh` when the user wants AI-generated professional, business, corporate, LinkedIn, or studio headshots. Keep reference preparation, conf
Referenced artifact was not completely inspected
- Use `scripts/headshots.sh` when the user wants AI-generated professional, business, corporate, LinkedIn, or studio headshots. Keep reference preparation, conf
Referenced artifact was not completely inspected
- Use `scripts/headshots.sh` when the user wants AI-generated professional, business, corporate, LinkedIn, or studio headshots. Keep reference preparation, conf
Referenced artifact was not completely inspected
- Use `scripts/headshots.sh` when the user wants AI-generated professional, business, corporate, LinkedIn, or studio headshots. Keep reference preparation, conf
Referenced artifact was not completely inspected
- Use `scripts/headshots.sh` when the user wants AI-generated professional, business, corporate, LinkedIn, or studio headshots. Keep reference preparation, conf
Referenced artifact was not completely inspected
- Use `scripts/headshots.sh` when the user wants AI-generated professional, business, corporate, LinkedIn, or studio headshots. Keep reference preparation, conf
Referenced artifact was not completely inspected
- Use `scripts/headshots.sh` when the user wants AI-generated professional, business, corporate, LinkedIn, or studio headshots. Keep reference preparation, conf
Referenced artifact was not completely inspected
- Use `scripts/headshots.sh` when the user wants AI-generated professional, business, corporate, LinkedIn, or studio headshots. Keep reference preparation, conf
Referenced artifact was not completely inspected
- Use `scripts/headshots.sh` when the user wants AI-generated professional, business, corporate, LinkedIn, or studio headshots. Keep reference preparation, conf
Referenced artifact was not completely inspected
- Use `scripts/headshots.sh` when the user wants AI-generated professional, business, corporate, LinkedIn, or studio headshots. Keep reference preparation, conf
Referenced artifact was not completely inspected
- Use `scripts/headshots.sh` when the user wants AI-generated professional, business, corporate, LinkedIn, or studio headshots. Keep reference preparation, conf
Referenced artifact was not completely inspected
- Use `scripts/headshots.sh` when the user wants AI-generated professional, business, corporate, LinkedIn, or studio headshots. Keep reference preparation, conf
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
`{"person_reference_id":"hperson_...","scene_id":"professional_profile"}` starts a new project.
- `POST /v1/headshots/projects/{project_id}/person-reference` with
`{"person_reference_id":"hperson_..."}` switches the active person inside the same project.
- `DELETE /v1/headshots/person-references/{person_reference_id}` soft-deletes only the library entry.
Applying a person to an existing project replaces its future preparation source and appends a new
immutable reference version. Historical jobs, candidates, favorites, and references remain intact.
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
require_key
person_id="${1:?remove-person requires a person reference id}" response="$(mktemp)"
trap 'rm -f "$response"' EXIT
api_json DELETE "/v1/headshots/person-references/$person_id" "$response"
echo "removed person reference $person_id from the library; existing projects are unchanged"
;;
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
args=(-sS -A "motu-mce-skill/1.0" "$BASE/v1/styles")
[ -n "${MCE_API_KEY:-}" ] && args+=(-H "X-API-Key: $MCE_API_KEY")
curl "${args[@]}" | python3 -c '
import sys, json
try:
d = json.load(sys.stdin)
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
args=(-sS -A "motu-mce-skill/1.0" "$BASE/v1/styles")
[ -n "${MCE_API_KEY:-}" ] && args+=(-H "X-API-Key: $MCE_API_KEY")
curl "${args[@]}" | python3 -c '
import sys, json
try:
d = json.load(sys.stdin)
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
args=(-sS -A "motu-mce-skill/1.0" "$BASE/v1/styles")
[ -n "${MCE_API_KEY:-}" ] && args+=(-H "X-API-Key: $MCE_API_KEY")
curl "${args[@]}" | python3 -c '
import sys, json
try:
d = json.load(sys.stdin)
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
args=(-sS -A "motu-mce-skill/1.0" "$BASE/v1/styles")
[ -n "${MCE_API_KEY:-}" ] && args+=(-H "X-API-Key: $MCE_API_KEY")
curl "${args[@]}" | python3 -c '
import sys, json
try:
d = json.load(sys.stdin)
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
args=(-sS -A "motu-mce-skill/1.0" "$BASE/v1/styles")
[ -n "${MCE_API_KEY:-}" ] && args+=(-H "X-API-Key: $MCE_API_KEY")
curl "${args[@]}" | python3 -c '
import sys, json
try:
d = json.load(sys.stdin)
The skill instructs use of shell scripts plus file read/write behavior but does not declare any tool scope or allowed-tools restrictions. In an agent environment, that expands the attack surface because ordinary user requests could trigger filesystem and shell operations without an explicit least-privilege boundary.
No suspicious patterns detected.