T09 · Insecure Skill Coding Practices
- Location
login.py:132- Finding
Authentication Artifacts Are Persisted Without Explicitly Restrictive Permissions
- Content
View full analysis
Vulnerability Details
File Locations:
SKILL.md:27-37login.py:132-134owa_calendar.py:98-100
Vulnerability Type: Plaintext storage of sensitive authentication material with permissions inherited from the process umask
Risk Level: MediumComplete Code Snippets
The documented configuration stores the Microsoft account password in plaintext:
json { "email": "your@company.com", "password": "your_password", "cookie_file": "/root/.outlook/cookies.json", "cookie_max_age_days": 7, "mfa_type": "authenticator_number_match" }login.pywrites the complete browser cookie collection without explicitly setting the file mode:python cookies = ctx.cookies() with open(COOKIE_FILE, "w") as f: json.dump(cookies, f, indent=2)owa_calendar.pysimilarly caches the intercepted bearer token:python TOKEN_FILE.parent.mkdir(exist_ok=True) with open(TOKEN_FILE, "w") as f: json.dump({"bearer": owa_token, "saved_at": time.time()}, f)Technical Analysis
The Skill stores three sensitive forms of authentication material under
~/.outlook/: a plaintext account password, the complete Playwright browser cookie collection, and a reusable bearer token. These files are created through ordinaryopen(..., "w")operations, so their effective permissions depend on the invoking process's umask. The directory is also created without explicitly enforcing mode0700.A permissive or incorrectly configured umask can make these files readable by other local users or processes. Browser cookies and bearer tokens may permit session replay without knowledge of the account password or completion of a new MFA challenge. The complete cookie collection can also contain authentication artifacts broader than the minimum data needed to read calendar events.
The network destinations observed in the audited code are official Microsoft endpoints and are consistent with ...[truncated 1554 chars]
- Remediation
View remediation
Remediation Suggestions
- Store the account password in the operating system's credential manager or a dedicated secret-management service rather than in
config.json. - Prefer a supported delegated OAuth authorization flow with the minimum calendar-read scope instead of automating password entry and capturing browser session tokens.
- Explicitly create
~/.outlookwith mode0700and verify its ownership before reading or writing sensitive files. - Create cookie and token files atomically with mode
0600, rather than relying on the process umask. - Reject sensitive files that are symbolic links or are owned by another user.
- Avoid persisting the bearer token where practical. If caching is required, use an encrypted credential store and retain it only for its actual server-defined lifetime.
- Store only the minimum cookies required for Outlook rather than the complete browser-context cookie collection.
- Delete expired tokens and obsolete cookies securely, and document a credential-revocation procedure.
- Store the account password in the operating system's credential manager or a dedicated secret-management service rather than in
