T09 · Insecure Skill Coding Practices
- Location
scripts/jira_api.py:187- Finding
Jira API Token Disclosure Through Arbitrary Generic Request Destinations
- Content
View full analysis
str: raw = f"{user}:{token}".encode("utf-8") return "Basic " + base64.b64encode(raw).decode("ascii") ``` Generic request handling at lines 187–200: ```python def cmd_request(args, cfg): server = cfg["server"] url = urllib.parse.urljoin(server + "/", args.path.lstrip("/")) if args.query: q = urllib.parse.urlencode(args.query) url += ("&" if "?" in url else "?") + q body = None if args.data_json: body = json.loads(args.data_json) elif args.data_file: with open(args.data_file, "r", encoding="utf-8") as f: body = json.load(f) status, j, raw = _http(args.method, url, args.headers, body) ``` Credential loading and header assignment at lines 636–646: ```python cfg = _read_jira_config(args.jira_config) host = urllib.parse.urlparse(cfg["server"]).hostname if not host: raise RuntimeError("Could not parse Jira hostname") user, token = _netrc_auth_for_host(host, args.netrc) args.headers = { "Accept": "application/json", "Authorization": _basic_auth_header(user, token), "User-Agent": "openclaw-skill/jira-api", } ``` ### Technical Analysis The script legitimately reads a Jira API token from `.netrc` and encodes the username and token using Base64 for HTTP Basic authentication. Base64 encoding is required by the authentication protocol and is not, by itself, evidence of covert exfiltration. The vulnerability occurs because the generic `request` command does not require `args.path` to be a relative Jira API path. It passes the value to `urllib.parse.urljoin()`: ```python url = urllib.parse.urljoin(server + ...[truncated 3103 chars]- Remediation
View remediation
