Si vous utilisez nginx pour votre site web, sachez qu’une mauvaise configuration peut conduire à d’éventuels problèmes de sécurité. Heureusement, pour contrer cela, il y a Gixy.
Gixy est un script Python qui analyse votre fichier nginx.conf à la recherche de problèmes éventuels comme :
- [ssrf] Server Side Request Forgery
- [http_splitting] HTTP Splitting
- [origins] Problems with referrer/origin validation
- [add_header_redefinition] Redefining of response headers by « add_header » directive
- [host_spoofing] Request’s Host header forgery
- [valid_referers] none in valid_referers
- [add_header_multiline] Multiline response headers
Pour installer gixy, entrez ceci dans votre terminal :
En passant, je ne sais pas si vous avez vu mais l’hébergeur Hostinger propose des offres super intéressantes en matière d’hébergement web. C’est pas trop cher pour démarrer et s’auto-héberger. (Lien affilié)
pip install gixy
Et voici comment l’utiliser :
$ gixy /etc/nginx/nginx.conf
==================== Results ===================
Problem: [http_splitting] Possible HTTP-Splitting vulnerability.
Description: Using variables that can contain « n » may lead to http injection.
Additional info: https://github.com/yandex/gixy/blob/master/docs/ru/plugins/httpsplitting.md
Reason: At least variable « $action » can contain « n »
Pseudo config:
include /etc/nginx/sites/default.conf;server {
location ~ /v1/((?<action>[^.]*).json)?$ {
add_header X-Action $action;
}
}==================== Summary ===================
Total issues:
Unspecified: 0
Low: 0
Medium: 0
High: 1