T09 · Insecure Skill Coding Practices
- Location
SKILL.md:23- Finding
Bearer Tokens and Private UseMemos Content Can Be Transmitted over Plaintext HTTP
- Content
View full analysis
My Account > Access Tokens, create one there, do not forget to assign expiration (i use Never to avoid troubles, but hey there are also arguments against that) ``` The scripts then send that bearer token and user data directly to the configured URL without validating its scheme. For example, `scripts/upload_attachment.py:40-52` contains: ```python req = urllib.request.Request( f"{base_url}/api/v1/attachments", data=payload, headers={ 'Authorization': f'Bearer {token}', 'Content-Type': 'application/json', 'Accept': 'application/json' }, method='POST' ) try: with urllib.request.urlopen(req) as resp: data = json.loads(resp.read().decode()) ``` Similarly, the common request logic in `scripts/memo_comments.py:27-39` is: ```python def api_request(base_url, token, path, method='GET', data=None): body = json.dumps(data).encode() if data else None req = urllib.request.Request( f"{base_url}{path}", data=body, headers={ 'Authorization': f'Bearer {token}', 'Content-Type': 'appli ...[truncated 3059 chars]- Remediation
View remediation
