Security: Silent config file parsing failures#609
Open
tomaioo wants to merge 1 commit intoPrimeIntellect-ai:mainfrom
Open
Security: Silent config file parsing failures#609tomaioo wants to merge 1 commit intoPrimeIntellect-ai:mainfrom
tomaioo wants to merge 1 commit intoPrimeIntellect-ai:mainfrom
Conversation
The Config classes in multiple packages (prime-mcp-server, prime-evals, prime-sandboxes, prime-tunnel) silently catch JSONDecodeError and IOError when loading ~/.prime/config.json, defaulting to empty config without warning the user. This can lead to unexpected authentication failures when config files are corrupted or have permissions issues. Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
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
Security: Silent config file parsing failures
Problem
Severity:
Medium| File:packages/prime-mcp-server/src/prime_mcp/core/config.py:L22The Config classes in multiple packages (prime-mcp-server, prime-evals, prime-sandboxes, prime-tunnel) silently catch JSONDecodeError and IOError when loading ~/.prime/config.json, defaulting to empty config without warning the user. This can lead to unexpected authentication failures when config files are corrupted or have permissions issues.
Solution
Add logging or warning when config file exists but fails to parse, so users know their configuration is being ignored.
Changes
packages/prime-mcp-server/src/prime_mcp/core/config.py(modified)Note
Low Risk
Low risk: adds a warning log on config parse/read errors without changing config resolution behavior.
Overview
Stops silently ignoring a broken
~/.prime/config.jsonby adding a module logger and emitting alogger.warningwhen JSON parsing or file I/O fails, while still falling back to an empty config.Reviewed by Cursor Bugbot for commit 1231014. Bugbot is set up for automated code reviews on this repo. Configure here.