fix(loader-server): a broken or looping symlink in the build folder crashes startup
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 68/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- bun, typescript
Direção de pesquisa
Read apps/server/src/files.ts and apps/client/src/files.ts, starting with the getFiles and addPath functions cited in the report. Check how each handles symlinks, filesystem errors, and paths that resolve outside the build folder. Done means broken or cyclic links no longer crash startup or recurse indefinitely, and files outside the build folder are not listed or served.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Which app is this bug report for?
server
Issue description
Also affects client.
getFiles uses statSync, which follows symlinks, and catches nothing:
- a dangling link throws
ENOENTand the server loader dies at startup; - a link to a parent folder recurses until the stack overflows.
The client's addPath catches errors per entry but loops the same way on cyclic links. A symlink inside the build folder that points outside it is also served, because resolveInside only checks the path as a string.
Found by reading the code path (not reproduced).
Expected: symlinks don't crash the loader, and only files inside the build folder are listed and served.
Suggested fix: use lstat and skip symlinks (or resolve them with realpath and keep only targets inside the root), and catch errors per entry.
Found during a read-only audit of main @ 044c766 (2026-11-11).
Code sample
const addPath = (path: string, exportedPath: string) => {
if (fs.statSync(path).isDirectory()) { // follows symlinks, throws on dangling ones
for (const file of fs.readdirSync(path)) addPath(join(path, file), join(exportedPath, file));
return;
}
paths.push([`/${exportedPath}`, path]);
};
Versions
- @nanoforge-dev/loader-client / @nanoforge-dev/loader-server / @nanoforge-dev/loader-website 1.7.0 (
main@ 044c766) - Bun 1.3.14
- Linux x86_64
Issue priority
Low (slightly annoying)
I have tested this issue on a development release
044c766
- Linguagem predominante
- TypeScript
- Estrelas
- 1
- Forks
- 0
- Merge médio
- 17h 25min
- PRs com merge (30d)
- 11
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de NanoForge-dev/Loader
-
app:client app:website enhancement refactor
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
NanoForge-dev/Loader#145 ·
Mantenedores costumam responder em até 1 dia
-
chore(loader-client,loader-server): package.json entry points name files the build does not produceAbertaapp:client app:server bug chore good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
NanoForge-dev/Loader#144 ·
Mantenedores costumam responder em até 1 dia
-
app:website bug good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
NanoForge-dev/Loader#141 ·
Mantenedores costumam responder em até 1 dia
-
app:website bug good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
NanoForge-dev/Loader#140 ·
Mantenedores costumam responder em até 1 dia
-
app:server bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
NanoForge-dev/Loader#138 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de NanoForge-dev/Loader
Issues semelhantes
-
Mend: dependency security vulnerability
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 65/100
fdm-monster/fdm-monster#5563 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
be-BOP-io-SA/be-BOP#2849 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 79/100
Mantenedores costumam responder em até 1 dia
-
1️⃣ phase/under-investigation flaky/confirmed flaky/needs-decision type/bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
growilabs/growi#12246 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
🐛 The Rulekeeper - An index run that gives up on the lock ends SucceededTalvez já em andamento @github-actions assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
SSWConsulting/SSW.Rules#2809 · 1 comentário ·
Mantenedores costumam responder em até 1 dia