T09 · Insecure Skill Coding Practices
Warning
- Location
- scripts/crawlora.sh:45
- Finding
- Overbroad Route and HTTP Method Authorization## Vulnerability Details **File Location**: `scripts/crawlora.sh`, lines 45–74 **Vulnerability Type**: Improper route and HTTP method allowlisting **Risk Level**: Medium The helper is intended to expose only the documented, read-only anime and manga API catalog. However, it permits both `GET` and `POST` for every accepted path and uses broad shell wildcard patterns that authorize undocumented descendant routes. ```bash # This skill's helper is limited to its documented Crawlora route set. Keep # caller-account surfaces and unrelated API routes out of the helper even if # someone supplies an undocumented path directly. case "$method" in GET|POST) ;; *) echo "only GET and POST are supported by the anime-manga-research skill" >&2 exit 2 ;; esac # Reject path syntax that could smuggle a route through a shell glob check. case "$path" in ""|*[?#%]*|*..*|*//* ) echo "invalid path for the anime-manga-research skill" >&2 exit 2 ;; esac case "$path" in /anime/airing-schedule) ;; /anime/character/*) ;; /anime/character/search) ;; /anime/rankings) ;; /anime/search) ;; /anime/title/*) ;; /anime/title/*/characters) ;; /anime/title/*/recommendations) ;; /anime/title/*/staff) ;; /manga/rankings) ;; /manga/search) ;; /manga/title/*) ;; /manga/title/*/characters) ;; /manga/title/*/recommendations) ;; /manga/title/*/staff) ;; *) echo "path is not in the anime-manga-research skill catalog" >&2 exit 2 ;; esac ``` ### Technical Analysis All 15 routes documented in `reference/endpoints.md` use the `GET` method, but the method check also permits `POST`. Method authorization is global rather than tied to each documented endpoint. The route checks are also prefix-like rather than exact route-shape validation. In Bash `case` patterns, `*` can match slash-delimited descendants. Consequently, patter ...[truncated 1911 chars]
- Remediation
- ## Remediation Suggestions 1. Remove `POST` support and allow only `GET`, matching every endpoint currently documented for this Skill. 2. Validate each route against an exact shape rather than a broad descendant wildcard. 3. Restrict identifiers to their documented format, preferably numeric AniList IDs, and ensure they occupy exactly one path segment. 4. Explicitly enumerate supported child routes: `/characters`, `/recommendations`, and `/staff`. 5. Reject all trailing or additional path segments. 6. Associate allowed methods with individual routes if write operations are introduced later, rather than using a global method allowlist. 7. Add negative tests confirming rejection of: - Every `POST` request. - Extra descendant segments. - Empty or nonnumeric identifiers. - Unsupported child routes. - Paths with trailing slashes where they are not explicitly supported. 8. Preserve the fixed HTTPS base URL and private temporary credential configuration, as those existing controls limit credential exposure. A safer validation approach would use anchored regular expressions, for example: ```bash [ "$method" = "GET" ] || { echo "only GET is supported" >&2 exit 2 } if [[ "$path" =~ ^/anime/(airing-schedule|rankings|search)$ ]] || [[ "$path" =~ ^/anime/character/search$ ]] || [[ "$path" =~ ^/anime/character/[0-9]+$ ]] || [[ "$path" =~ ^/anime/title/[0-9]+(/(characters|recommendations|staff))?$ ]] || [[ "$path" =~ ^/manga/(rankings|search)$ ]] || [[ "$path" =~ ^/manga/title/[0-9]+(/(characters|recommendations|staff))?$ ]]; then : else echo "path is not in the anime-manga-research skill catalog" >&2 exit 2 fi ```
