fix(session): enforce owner-only ACL for managed tool output on Windows

Open
#1,385 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
security

Research direction

Start at the managed tool output write path where os.open(..., 0o600) and chmod(0o700) are used, then read raven/utils/atomic_io.py and the existing _create_with_dacl_of helper to see how DACLs are applied. A new file has no source DACL, so the Windows path needs a restricted DACL set at or before creation, plus a Windows test proving a non-owner cannot read the file. Done when that test passes and POSIX behavior remains unchanged.

Written by the indexing model from the issue text.

Description

bug

The managed tool output file is created with os.open(..., 0o600) and
chmod(0o700); on Windows those calls only toggle the read-only
attribute, so the file inherits the workspace directory's ACL. On POSIX
the file and directory are owner-only. #1375 documents the POSIX-only
guarantee; this issue tracks the Windows hardening.

A real owner-only file on Windows needs a restricted DACL at creation.
raven/utils/atomic_io.py has a _create_with_dacl_of helper, but it
copies an existing file's DACL; a new managed file has no like source.

Acceptance: a Windows test proves a non-owner cannot read the managed
file, and the write path sets the DACL before or at creation.

Dominant language
Python
Stars
4.1k
Forks
94
Avg merge
2d 7h
Merged PRs (30d)
216

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EverMind-AI/Raven

All issues in EverMind-AI/Raven

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.