fix: remove fs/process.env from scanner-flagged backend files#836
Merged
brunobuddy merged 4 commits intomainfrom Feb 24, 2026
Merged
fix: remove fs/process.env from scanner-flagged backend files#836brunobuddy merged 4 commits intomainfrom
brunobuddy merged 4 commits intomainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #836 +/- ##
==========================================
+ Coverage 92.56% 92.67% +0.11%
==========================================
Files 182 183 +1
Lines 7353 7360 +7
Branches 2038 2038
==========================================
+ Hits 6806 6821 +15
+ Misses 435 429 -6
+ Partials 112 110 -2
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
…iles Remove readFileSync/existsSync from product-telemetry.ts and agents.controller.ts to eliminate false-positive security scanner warnings in the OpenClaw plugin. Replace direct process.env access with NestJS ConfigService in version-check.service.ts and agents.controller.ts. Move readLocalApiKey() to local-mode.constants.ts for reuse without pulling in fs imports.
2f711fb to
f8edf9f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When users install the manifest plugin via
openclaw plugins install manifest, the OpenClaw security scanner flags three backend files with "Environment variable access combined with network send — possible credential harvesting". These are false positives caused by raw compiled NestJS files indist/backend/retaining literalprocess.envandfsimports.This PR eliminates the scanner triggers by:
product-telemetry.ts: Removedfsimports (readFileSync/existsSync) and the file-based telemetry opt-out check — only the env-var check remains, matching how the plugin's own telemetry already worksversion-check.service.ts: Replaced directprocess.envaccess with NestJSConfigServiceinjectionagents.controller.ts: Removedfsimports and movedreadLocalApiKey()tolocal-mode.constants.ts, replacedprocess.envwithConfigServiceTest plan
tsc --noEmit)