Website contains Mercurial metadata directory

Published on 19 Apr 2022
1 min read
Vulnerability
metadata

Mercurial is one of the version control tools for all software developers. Mercurial metadata directory (.hg) was found in this folder. The metadata is used to keep track of all the changes in the source code of the application before it is committed to the central repository. The .hg gets ended up on the live server if the files are copied directly from the repository. An attacker can easily extract sensitive information along with the source code of the application by requesting the hidden .hg metadata directory.

Impact

One of the significant impacts for this vulnerability is a significant data breach using the .hg file. The attacker will get the source code of the application along with sensitive information.

Mitigation / Precaution

Beagle recommends the following solutions:-

  • Restrict access to the .hg directory. This restriction can be applied by adding the below codes in global config, vhost/directory or .htaccess.
        <Directory ~ "\.hg">
        Order allow,deny
        Deny from all
        </Directory>

    
Manindar Mohan
Written by
Cyber Security Lead Engineer

Manieendar is a dedicated Security Engineer with a wealth of experience in the cybersecurity landscape. He plays a pivotal role at Beagle Security, where he employs his extensive knowledge to safeguard systems against cyber threats. Manieendar's passion for cybersecurity extends beyond his professional role; he actively contributes to the online security community through insightful articles and speaking engagements.

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