fix: harden macOS bar launch descriptor (#1533)

Hardens the macOS bar launch.json descriptor against untrusted/foreign-owned files and constrains the decoded descriptor; blocks dashboard file writes to the launch descriptor.
This commit is contained in:
Kai (Tam Nhu) Tran authored and GitHub committed 2026-06-15 23:24:13 -04:00
1 parent 619723e9b7
commit 10aff10a67
3 files changed
+106 -3

No files matched your search

@@ -42,6 +42,22 @@ describe('validateFilePath', () => {
expect(result.readonly).toBe(false);
});
test('rejects writes to the macOS bar launch descriptor', () => {
const filePath = path.join(tempDir, '.ccs', 'bar', 'launch.json');
const result = validateFilePath(filePath);
expect(result.valid).toBe(false);
expect(result.readonly).toBe(false);
});
test('still allows other writes inside the bar directory', () => {
const filePath = path.join(tempDir, '.ccs', 'bar', 'serve.log');
const result = validateFilePath(filePath);
expect(result.valid).toBe(true);
expect(result.readonly).toBe(false);
});
test('rejects sibling paths that only share ~/.ccs prefix', () => {
const bypassPath = path.join(tempDir, '.ccs-evil', 'config.yaml');
const result = validateFilePath(bypassPath);