Skip to content

Security: Silent config file parsing failures#609

Open
tomaioo wants to merge 1 commit intoPrimeIntellect-ai:mainfrom
tomaioo:fix/security/silent-config-file-parsing-failures
Open

Security: Silent config file parsing failures#609
tomaioo wants to merge 1 commit intoPrimeIntellect-ai:mainfrom
tomaioo:fix/security/silent-config-file-parsing-failures

Conversation

@tomaioo
Copy link
Copy Markdown

@tomaioo tomaioo commented May 7, 2026

Summary

Security: Silent config file parsing failures

Problem

Severity: Medium | File: packages/prime-mcp-server/src/prime_mcp/core/config.py:L22

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.

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.json by adding a module logger and emitting a logger.warning when 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.

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>
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.

1 participant