Nginx off-by-slash exposes Git config

Published on 20 Dec 2021
Vulnerability

Description

Nginx is one of the most commonly used web servers. We can scan for misconfigurations and security vulnerabilities in Nginx. With the Off-by-slash misconfiguration, it is possible to traverse one step up the path due to a missing slash it is possible to read the source code of the web application. The web server responded with a list of files located in the target directory. An attacker can see the files located in the directory and could potentially access files which disclose sensitive information.

Mitigation measures

  • Change your nginx.conf file. A secure configuration for the requested directory similar to the following:
    location /{YOUR DIRECTORY} {
            autoindex off;
    }
   
  • Configure the web server to disallow directory listing requests.

  • Ensure that the latest security patches have been applied to the web server and the current stable version of the software is in use.

Febna V M
Written by
Cyber Security Engineer

Febna once spent an entire evening arguing with an AI chatbot just to prove that machines can be confidently wrong. The debate ended with no clear winner, but it did spark her curiosity for the fascinating world of artificial intelligence. Today, she works at the intersection of AI and cybersecurity, helping build smarter systems while making sure they don’t become too smart for their own good. When she’s not exploring the future of technology, she’s probably asking “but what if?” one more time.

Experience the Beagle Security platform
Unlock one full penetration test and all Advanced plan features free for 14 days
4.8 on G2 • ISO 27001 certified
See How Beagle Security Works
No credit card • No setup required
Launch interactive demo