Skip to content

fix(openclaw): remove process.env access to clear security scanner warning#4676

Merged
whysosaket merged 1 commit intomainfrom
fix/remove-process-env-security-warning
Apr 2, 2026
Merged

fix(openclaw): remove process.env access to clear security scanner warning#4676
whysosaket merged 1 commit intomainfrom
fix/remove-process-env-security-warning

Conversation

@chaithanyak42
Copy link
Copy Markdown
Contributor

What

Removes process.env access from the plugin to clear OpenClaw's security scanner warning:

WARNING: Plugin openclaw-mem0 contains dangerous code patterns: Environment variable access combined with network send — possible credential harvesting

Why

OpenClaw's static analyzer flags process.env + network calls as credential exfiltration. Our resolveEnvVars() read env vars to expand ${MEM0_API_KEY} syntax, then the mem0ai SDK made HTTP calls — triggering the scanner.

This was redundant: OpenClaw already resolves ${VAR} in openclaw.json before passing pluginConfig to the plugin's register() function. The API key arrives pre-resolved.

Fix

Removed resolveEnvVars() and resolveEnvVarsDeep() from config.ts. Zero process.env access in the plugin bundle. Config values pass through as-is since OpenClaw handles env var substitution at the framework level.

Files changed

openclaw/config.ts — removed 2 functions (25 lines), updated 2 call sites to pass values directly.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

…rning

OpenClaw's static analyzer flags process.env + network calls as
"credential harvesting". Removed resolveEnvVars() and resolveEnvVarsDeep()
from config.ts. OpenClaw already resolves ${VAR} in openclaw.json before
passing pluginConfig to register(), so plugin-side resolution was redundant.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@chaithanyak42 chaithanyak42 force-pushed the fix/remove-process-env-security-warning branch from eb8355c to adad1af Compare April 2, 2026 15:34
@whysosaket whysosaket merged commit 9cd3d2c into main Apr 2, 2026
6 checks passed
@whysosaket whysosaket deleted the fix/remove-process-env-security-warning branch April 2, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants