[bug] STATVS secret filter accepts classic GitHub tokens (ghp_…): the rule expects a dash
Los mantenedores suelen responder en 5 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- bun, typescript
Línea de trabajo
Empieza por LIFEOS/STATVS/lib/refuse.ts:16 y lee cómo usan SECRET_RES credentialRefusal y validateEvent de Vigil. Comprueba si las pruebas existentes cubren cada prefijo de token de GitHub y el límite entre 35 y 36 caracteres; el issue informa de una prueba local y una regla propuesta, pero no menciona ningún archivo de pruebas. Se considera terminado cuando se rechacen las formas clásicas de tokens en ambos modos, mientras que las cadenas ordinarias enumeradas sigan aceptándose.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Version
LifeOS 8.761.0 · attestation: 180 system file(s) differ from danielmiessler/[email protected] · 9 system file(s) missing:
- hooks/VoiceCompletion.hook.ts
- hooks/DriftReminder.hook.ts
- hooks/ISASync.hook.ts
- hooks/ModelDriftGuard.hook.ts
- hooks/README.md
- hooks/ISARenderOnStop.hook.ts
- hooks/PromptProcessing.hook.ts
- hooks/lib/work-config.ts
- hooks/lib/herdr-tabs.ts
- hooks/lib/format-caps.ts
- hooks/lib/notification-channel.ts
- hooks/FormatGate.hook.ts
- hooks/SubagentGitSandbox.hook.ts
- hooks/handlers/VoiceNotification.ts
- hooks/handlers/DocCrossRefIntegrity.ts
- hooks/handlers/UpdateCounts.ts
- skills/Prioritize/Tools/Prioritize.ts
- skills/Prioritize/Setup.md
- skills/StateLog/SKILL.md
- skills/Errata/Tools/Er.ts
- skills/Errata/Tools/Send.ts
- skills/Errata/Intents/Send.md
- skills/CreateSkill/SKILL.md
- skills/CreateSkill/Intents/OptimizeDescription.md
- skills/CreateSkill/Intents/CreateSkill.md
- skills/RichFormat/tests/engine.test.tsx
- skills/RichFormat/hooks/table.ts
- skills/RichFormat/hooks/workflow.ts
- skills/RichFormat/hooks/register.tsx
- skills/RichFormat/hooks/stream.ts
- skills/RichFormat/hooks/enrich.ts
- skills/RichFormat/SKILL.md
- skills/LifeOSHooks/hooks/LifeOSHooks.ts
- skills/Herdr/Intents/Configure.md
- skills/Interview/Intents/Phase0Setup.md
- skills/LifeOS/Tools/Report.ts
- skills/LifeOS/SKILL.md
- skills/Fabric/Patterns/create_better_frame/system.md
- skills/Fabric/Patterns/extract_article_wisdom/README.md
- skills/Fabric/Patterns/extract_wisdom/README.md
- …and 140 more
What is broken
The STATVS secret filter (SECRET_RES in LIFEOS/STATVS/lib/refuse.ts, shared by STATVS credentialRefusal and Vigil validateEvent) does not catch classic GitHub tokens. Its token rule is /\b(?:sk|pk|ghp|glpat|csk)-[A-Za-z0-9_-]{16,}/i, with a dash after ghp, but GitHub's tokens use an underscore: ghp_, gho_, ghu_, ghs_, ghr_ plus 36 characters. At 40 characters a classic token is also under the 48-character long-run rule, so nothing in SECRET_RES matches it, and a STATVS row or Vigil event carrying one is accepted. Fine-grained tokens (github_pat_…, 93 characters) are caught today, but only by the generic long-run rule.
Where (file:line)
LIFEOS/STATVS/lib/refuse.ts:16
Repro on a clean tree
On a clean 8.761.0 tree, with a synthetic value:
`bun -e 'import {credentialRefusal} from "./LIFEOS/STATVS/lib/refuse.ts"; const t="ghp_"+"Ab3x".repeat(9); console.log(credentialRefusal(t)??"ACCEPTED", credentialRefusal(t,{slugs:true})??"ACCEPTED")'`
Expected: refused twice. Actual: `ACCEPTED ACCEPTED`. Negative control: the same value with `ghp-` is refused. The captured probe below shows the classic form accepted, the fine-grained form and the dash form refused.
Negative control
Probe: cd /tmp/claude-501/d3 && bun probe-token.ts · exit 1 · captured 2026-12-02T10:51:06.128Z
Red looks like: GITHUB TOKEN ACCEPTED
classic ghp_: ACCEPTED | fine-grained github_pat_: Credential-shaped string refused | dash control ghp-: Credential-shaped string refused
GITHUB TOKEN ACCEPTED
Suggested fix
One added rule in SECRET_RES, case-sensitive like GitHub's prefixes, without a left word boundary so a token glued to a prefix (MY_TOKEN_ghp_…) is still caught:
/\b(?:sk|pk|ghp|glpat|csk)-[A-Za-z0-9_-]{16,}/i,
+ // GitHub's own token forms use an underscore (classic gh?_ + 36, fine-grained github_pat_ + 22 + "_" + 59).
+ // No left boundary, so a token glued to text before it is still caught. Case-sensitive, and the fine-grained form
+ // needs its first 22 unbroken letters and digits, so GITHUB_PAT_SOME_SETTING stays accepted.
+ /(?:gh[pousr]_[A-Za-z0-9]{36,}|github_pat_[A-Za-z0-9]{22,})/,
Tested locally with a new refuse.test.ts: synthetic tokens of every prefix at the edge lengths (35 accepted, 36 refused), glued prefixes, both modes, and ordinary rows that must stay accepted (paths, slugs, 12-char commit refs, ghost_town, GITHUB_PAT_CONFIGURATION_GUIDE_FOR_CI). Vigil's tests stay green. Trade-off: github_pat_ followed by one unbroken 22+ letter word is refused.
Environment
- OS: macOS 27.0 (arm64)
- Harness: claude-code
- bun: 1.4.3 · git: 2.54.0
- Doctor broken: none
- Lenguaje dominante
- TypeScript
- Estrellas
- 20.7k
- Forks
- 2.6k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de danielmiessler/LifeOS
-
Interceptor LaunchTestProfile.sh: no Windows (Git Bash/MSYS) branch, test profile never launchesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
danielmiessler/LifeOS#3150 ·
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
danielmiessler/LifeOS#3038 · 1 comentario ·
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
danielmiessler/LifeOS#2977 · 1 comentario ·
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
danielmiessler/LifeOS#2954 · 1 comentario ·
Los mantenedores suelen responder en 5 días
-
Accepting a proposal in Pulse returns ok, but CENSVS refuses the move and the two records stay apartAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
danielmiessler/LifeOS#3149 · 2 comentarios ·
Los mantenedores suelen responder en 5 días
Todos los issues de danielmiessler/LifeOS
Issues similares
-
Media browser returns "Not found" for repositories using the SHA-256 object formatPosiblemente ocupada @adamchodera la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Follow-ups from #312Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
janhesters/remixcn#318 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Make the "%" unit spacing the same in the web and in A10Posiblemente ocupada @kragent66-glitch la tomó hoy. Abiertobug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
maiychrus25/OpenTea-DX-OS#226 · 1 comentario ·
-
NP OSS
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
siteboon/claudecodeui#1905 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día