T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/publish_guidelines.py:15- Finding
Workspace-wide credential file is loaded without least-privilege filtering
- Content
View full analysis
Vulnerability Details
File Location:
scripts/publish_guidelines.py, lines 15–16
Vulnerability Type: Excessive access to shared credentials
Risk Level: Mediumpython # 환경 변수 로드 from dotenv import load_dotenv env_file = Path.home() / '.openclaw' / 'workspace' / '.env' load_dotenv(env_file)Technical Analysis
The script loads the entire shared workspace
.envfile into its process environment. The declared functionality only requires a limited set of Notion configuration values, principallyNOTION_API_KEY,SECURITY_GUIDE_DATABASE_ID, and the documented fallback database ID.Loading the complete shared file makes every variable stored there accessible to all code executing in the process, including the dynamically imported crawler, configuration, and publisher modules. This violates least privilege because unrelated credentials may be exposed even though they are not necessary for guideline collection or publication.
The Skill documentation confirms that the file may also contain
SECURITY_NEWS_GLM_API_KEY, which is not required by this direct-publishing workflow. The audit found no code in the packaged script that intentionally transmits unrelated secrets, but the unnecessarily broad credential scope increases the consequences of a compromised, substituted, or vulnerable dependency.Attack Path
- A user stores Notion credentials and other service credentials in
~/.openclaw/workspace/.env, as directed by the Skill documentation. - The user invokes
scripts/publish_guidelines.py. load_dotenv(env_file)loads every value from the shared file into the process environment.- The script imports and invokes code from the external
security-news-module. - If that external module is malicious or compromised, it can enumerate the process environment and retrieve unrelated credentials.
- The acquired credentials can then be used through their corresponding external services, sub ...[truncated 578 chars]
- A user stores Notion credentials and other service credentials in
- Remediation
View remediation
Remediation Suggestions
- Use a Skill-specific configuration file containing only the credentials required for guideline publication.
- Do not load the complete workspace-wide
.envinto the process. - Explicitly parse and validate an allowlist of required variables, such as:
NOTION_API_KEYSECURITY_GUIDE_DATABASE_IDSECURITY_NEWS_DATABASE_ID, only when the documented fallback is intentionally enabled
- Remove
SECURITY_NEWS_GLM_API_KEYand other unrelated credentials from the environment used by this direct-publishing workflow. - Run the process with a dedicated Notion integration whose permissions are restricted to the intended guideline database.
- Ensure the credential file is readable only by its owner and never print complete environment contents in logs or diagnostic output.
- If shared configuration cannot be avoided, isolate imported dependencies in a subprocess supplied with a minimal, explicitly constructed environment.
