aaif-goose / aaif-goose/goose

fix(security): harden temp file permissions for sensitive data

Đang mở
#11,620 1 bình luận 0 reaction 1 người được giao Được @jbg nhận Xem trên GitHub
Ngôn ngữ chính
Rust
Star
54.2k
Fork
6.2k
Merge trung bình
3 ngày 2 giờ
Pull request đã merge (30 ngày)
262

Mô tả

### Description

In goose's Rust codebase, temp files may be created for handling sensitive data (API keys in logs, tool outputs, etc.). Ensuring 0o600 permissions is important for multi-user systems.

### Suggested audit

- Search for `NamedTempFile`, `tempfile`, `std::fs::write` with sensitive content
- Ensure 0o600 on Unix
- Add explicit permission setting where needed

### Location

- `crates/goose/src/agents/`
- `crates/goose/src/session/`
- Any credential handling

### Fix

```rust
use std::os::unix::fs::PermissionsExt;
let file = tempfile::NamedTempFile::new()?;
std::fs::set_permissions(file.path(), Permissions::from_mode(0o600))?;
```

### Why

Goose handles API keys, private code, and user data. Defense in depth.

Happy to PR.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.