T09 · Insecure Skill Coding Practices
Warning
- Location
- scripts/crawlora.sh:35
- Finding
- Unnecessary POST Support Permits Sensitive Data Forwarding to a Third-Party API<![CDATA[ ## Vulnerability Details **File Location**: `scripts/crawlora.sh`, lines 35–43, 54–59, and 119–126 **Vulnerability Type**: Excessive network capability and arbitrary request-body forwarding **Risk Level**: Medium ### Vulnerable Code ```bash method="GET" body="" args=() while [ $# -gt 0 ]; do case "$1" in -X) method="$2"; shift 2 ;; -d) body="$2"; shift 2 ;; *) args+=("$1"); shift ;; esac done ``` ```bash case "$method" in GET|POST) ;; *) echo "only GET and POST are supported by the ats-job-boards-research skill" >&2 exit 2 ;; esac ``` ```bash else [ -n "$body" ] || body="${rest[0]:-}" [ -n "$body" ] || body='{}' # Stream the body on stdin so curl never interprets a user value as its # @file shorthand (and cannot read local files supplied in a request body). printf '%s' "$body" | curl -fsS -X "$method" "${auth[@]}" \ -H "Content-Type: application/json" --data-binary @- "${base}${path}" fi ``` ### Technical Analysis The endpoint catalog in `reference/endpoints.md` documents all 30 supported ATS endpoints as HTTP `GET` operations. Nevertheless, the helper accepts `POST` and allows the caller to provide an arbitrary JSON request body through `-d` or a positional argument. It then forwards that body to `https://api.crawlora.net/api/v1`. Although the destination is fixed, uses HTTPS, and cannot be redirected through an environment variable, arbitrary request-body transmission is not required for the declared ATS job-board research functionality. It therefore exceeds the skill's minimum necessary network privileges. The implementation protects against curl's `@file` expansion by streaming the body through standard input. Consequently, this issue does not independently permit arbitrary local-file reads. Exploitation instead requires an agent, user, or untrusted instruction source to place sensitive information directly into the body. The fixed destination and route allowlist limit disclosure to the Crawl ...[truncated 1685 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove support for `POST`, `-X`, and `-d`, because every endpoint documented for this skill uses GET: ```bash method="GET" args=("$@") ``` 2. Reject method-related options explicitly so they cannot be interpreted as ordinary arguments: ```bash case "${1:-}" in -X|-d|--request|--data|--data-raw|--data-binary) echo "only documented GET requests are supported" >&2 exit 2 ;; esac ``` 3. Validate query parameter names separately for each allowed endpoint. For example, `/jobs/company-search` should accept only `slug`, while `/jobs/greenhouse/job` should accept only `token` and `id`. 4. Reject malformed arguments that do not follow the expected `name=value` form and enforce reasonable value-length limits. 5. Retain the existing fixed HTTPS API base, route allowlist, API-key character validation, private temporary configuration file, and rejection of curl `@file` syntax. 6. Add automated tests confirming that POST requests, body options, undocumented parameters, non-allowlisted paths, path traversal syntax, and local-file expansion attempts are rejected before any network request occurs. ]]>
