Skip to content

🛡️ Sentinel: Secure socket creation in private directory#104

Open
minibota wants to merge 1 commit intomainfrom
security/nightly-2026-02-04-10612344924168496973
Open

🛡️ Sentinel: Secure socket creation in private directory#104
minibota wants to merge 1 commit intomainfrom
security/nightly-2026-02-04-10612344924168496973

Conversation

@minibota
Copy link
Copy Markdown
Contributor

@minibota minibota commented Feb 4, 2026

🔐 Issue: The daemon created its Unix socket directly in /tmp/ with a predictable name (cc-agent-<user>.sock). This allowed local attackers to pre-create the socket file (DoS) or potentially hijack the connection if directory permissions were loose.

🧠 Risk: Denial of Service (preventing agent startup) or Information Disclosure (if attacker tricks exec command into connecting to their socket).

🛠️ Fix:

  • Changed socket location to a private subdirectory: /tmp/cc-agent-<uid>/cc-agent.sock (or /tmp/cc-agent-<user>/ on Windows).
  • Added ensureSocketDir helper to enforce 0700 permissions on this directory before creation.
  • Updated daemon to use this new secure path logic.

🧪 Tests:

  • Added TestEnsureSocketDir to verify directory creation and permission enforcement.
  • Ran existing tests go test -v ./cmd/... (passed).

📎 Notes:

  • This is a BREAKING CHANGE for the socket path. However, the agent automatically updates the managed cron file with the new path upon startup (via sync_jobs), so service disruption should be minimal (only pending jobs during the restart window might fail).
  • exec command automatically picks up the new path if --socket-path is not specified, or via the updated cron job arguments.

Automated nightly security task.


PR created automatically by Jules for task 10612344924168496973 started by @minibota

…sions

Co-authored-by: minibota <1483356+minibota@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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