Skip to content

Security: write ~/.cursor/mcp.json with 0600 permissions (it holds MCP auth headers) #171

Closed

Description

@vsn411

Problem: secfoo mcp sync --agent agent writes the configured MCP servers into ~/.cursor/mcp.json, including their env and headers. Those usually hold secrets: the secfoo-memory bearer key, or a Jira or Confluence token. The file is created with the process umask (usually 0644, readable by every user on the machine). The equivalent Claude file is set to 0600 on purpose (write_claude_mcp_config, comment "Header values ... are secrets").

Build: after writing ~/.cursor/mcp.json, chmod it to 0o600, using the same pattern as write_claude_mcp_config. Do this whether the file is new or already existed. On Windows chmod is close to a no-op, so don't let it fail the sync.

Where to look: src/secfoo/mcp.py (sync_cursor, write_claude_mcp_config), tests/test_mcp.py.

Done when: a POSIX-only test (skip on Windows) checks that stat.S_IMODE(path.stat().st_mode) == 0o600 after a sync, for both a new file and one that already existed with 0644.

Activity

  1. added
    bug
    good first issue
    help wanted
    hackathon
    difficulty: low
    on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugdifficulty: lowgood first issuehackathonhelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions