[bug] settings.system.json: single-slash permission rules miss system dirs

Aperta Adatta ai principianti
#2,954 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 5 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
tooling

Direzione di ricerca

Trova dove settings.system.json definisce le otto regole di autorizzazione e controlla come vengono assemblate le impostazioni di sistema e le sovrapposizioni di installazione. Leggi il punto di ingresso per il controllo o l’analisi delle impostazioni menzionato nella codebase, se presente. Aggiorna le regole affinché usino due barre iniziali e assicurati che le sovrapposizioni con un proprio array deny non vuoto ricevano la stessa correzione; il lavoro è completato quando tutte e otto le regole puntano ai percorsi del filesystem descritti e viene rilevata la regressione con una sola barra.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What happened

settings.system.json writes its system-directory permission rules with one leading slash, so Claude Code resolves them under the settings root and they do not protect the system directories they name. On a case-insensitive volume the bin rule blocks edits to the install's own Bin folder instead.

Summary

What happens

settings.system.json writes eight permission path rules with one leading slash. Claude Code reads a single leading slash as relative to the settings root, and a double slash as the filesystem root. So these rules point inside the install, not at the system.

Deny rules affected (rule text shown without its leading slash, so a path scrubber leaves it readable): Edit(System/**), Edit(bin/**), Edit(etc/**), Edit(sbin/**), Edit(usr/**).

Allow rules affected, same notation: Edit(private/tmp/**), Edit(tmp/**), Edit(var/folders/**).

Effect

  • The five deny rules give no protection to the system directories.
  • On a case-insensitive volume, the macOS default, the bin rule matches the install's own Bin folder. The assistant is refused when it edits a script there: "File is in a directory that is denied by your permission settings".
  • The three allow rules grant edits under same-named folders inside the install, not the temp directories.

How I confirmed it (8.761.0, macOS)

  1. An Edit of a script in the install's Bin folder was refused with the message above.
  2. I changed the bin rule to the double-slash form. The same Edit then succeeded.
  3. I moved the other deny rules to the double-slash form and probed each with an Edit against a file that does not exist. The system usr, bin, sbin, System and etc directories each refused with the deny message. A control inside the install's Bin folder returned "File does not exist", so it was no longer blocked.

Suggested fix

Write all eight rules with the double leading slash. A lint in the settings check that rejects any Edit(, Read( or Write( rule starting with exactly one slash would stop it coming back.

One note for whoever picks this up: an install whose overlay carries its own non-empty deny array replaces the system list, so that overlay needs the same correction.

Details

  • Kind: bug
  • LifeOS version: 8.761.0

Filed with the LifeOS /feedback command. The reporter approved this exact text before it was sent; paths, secrets and personal details were stripped locally.

Lingua principale
TypeScript
Stelle
20.7k
Fork
2.6k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di danielmiessler/LifeOS

Tutte le issue di danielmiessler/LifeOS

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.