T09 · Insecure Skill Coding Practices
- Location
__init__.py:31- Finding
Undocumented Hardcoded Exchange Endpoint May Receive Credentials
- Content
View full analysis
Vulnerability Details
File Location:
__init__.py, lines 31–55; duplicated configuration logic at lines 166–181
Vulnerability Type: Insecure credential and endpoint configuration
Risk Level: HighVulnerable Code
python domain = os.getenv('EXCHANGE_DOMAIN', 'friendly-it') username = os.getenv('PICARD_USERNAME', 'picard') email = os.getenv('EXCHANGE_EMAIL', 'picard@friendly-it.com') password = os.getenv('PICARD_PASSWORD') server = os.getenv('EXCHANGE_SERVER', 'oberau.friendly-it.at') if not password: raise ValueError("EXCHANGE_PASSWORD not found in .env.credentials") creds = Credentials(username=f"{domain}\\{username}", password=password) config = Configuration( server=server, credentials=creds, auth_type=NTLM, version=Version(EXCHANGE_2010_SP2) ) return Account( primary_smtp_address=email, config=config, autodiscover=False, access_type=DELEGATE )Technical Analysis
The implementation silently defaults to the organization-specific Exchange endpoint
oberau.friendly-it.atand identity values such asfriendly-it,picard, andpicard@friendly-it.com. These defaults are not disclosed inSKILL.md.The documented credential variable is
EXCHANGE_PASSWORD, but the implementation readsPICARD_PASSWORD. This inconsistency can cause credentials inherited from the environment or supplied under the implementation-specific variable to be used with the hardcoded endpoint whenEXCHANGE_SERVERis absent.Because NTLM authentication is configured with the resulting credentials, invoking any public operation that calls
get_account()can initiate authentication against that endpoint. The same unsafe configuration pattern is repeated inget_shared_calendar().Attack Path
- A user or execution environment supplies
PICARD_PASSWORD, intentionally or through an inherited environment variable. EXCHANGE_SERVERis absent because the user follows incomplete configuration, re ...[truncated 1035 chars]
- A user or execution environment supplies
- Remediation
View remediation
Remediation Suggestions
- Remove all organization-specific default values for the server, domain, username, and email address.
- Require explicit
EXCHANGE_SERVER,EXCHANGE_DOMAIN,EXCHANGE_USERNAME,EXCHANGE_EMAIL, andEXCHANGE_PASSWORDsettings. - Align implementation variable names with those documented in
SKILL.md. - Fail closed with a clear configuration error if any mandatory setting is absent.
- Validate the configured Exchange server against an administrator-controlled allowlist where feasible.
- Consolidate Exchange configuration in one function so
get_account()andget_shared_calendar()cannot diverge. - Avoid placing credentials into global process environment state when a scoped configuration object can be used.
- Add tests confirming that missing endpoint configuration never triggers a network connection.
