Dark Reading is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them.Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Risk

HTML Access Control Busted By Security Researchers

Open source HTExploit tool can bypass a standard directory protection technique used to secure many types of Web pages, security experts demonstrated at Black Hat.

Two researchers presenting at last week's Black Hat conference in Las Vegas demonstrated a new technique they've discovered for bypassing .htaccess files. Also known as hypertext access files, they're primarily used for setting directory-level access controls for websites, and are common across multiple types of Web server software--including the open source Apache HTTP Server, which is the most commonly used Web server software in the world.

The two presenters--security researcher Maximiliano Soler, who works for Standard Bank in Argentina, and penetration tester Matias Katz, who founded Mkit Argentina--also released a tool under open source license, written in Python, that they developed to exploit the vulnerability. According to the presenters, the tool, named HTExploit, lets users list the contents of a directory protected this way, bypassing the authentication process.

They emphasized that their tool was designed to be used from within protected directories--run by people who already have access to a Web server--rather than via a publicly accessible site. But the vulnerability they uncovered could be used by outsiders to gain access, via the Internet, to parts of websites that are ostensibly protected by an .htaccess file.

[ Black Hat presenters warn of a possible attack on network-connected hardware. Read more at Mass Router Infection Possible: Black Hat. ]

Why bother attacking .htaccess files? The answer is simple: any directory that someone takes the time to protect is more likely to contain sensitive or secret information. "Today [it] is common to find lazy administrators and/or developers using directories located on the same Web server to save backups files, configurations, their own jobs, outdated versions, or new developments to be implemented in the future," the researchers wrote in a related white paper.

The good news is that with some small HTML and PHP tweaks to fix the exploitable configuration errors, thus restricting the types of access requests that can be made, vulnerable .htaccess pages can be made immune to the exploit outlined by Soler and Katz.

The bad news is that the problem they've uncovered may be quite widespread, and it could be used to compromise not just any directory that contains a misconfigured .htaccess file, but potentially any PHP file on the same site.

"What Katz and Soler described in their session is not some rare 'corner case' hack that could only possibly occur in a lab with billions of automated attempts; this is easily testable in the real world, and the tools to exploit it are freely available," said ESET security researcher Cameron Camp in a blog post.

The vulnerability stems from the fact that Apache "hands off PHP-based requests within .htaccess to PHP itself, which has been working fine on millions and millions of websites for years," said Camp. But if the .htaccess file gets fed some type of nonstandard input--in effect, injected--then "PHP automatically--unless otherwise instructed--treats it as a GET request, and allows the utility to start saving the PHP files on a webserver to your local filesystem," he said.

From there, however, the process continues, and begins combing accessed PHP files for any links they contain to other files on the same Web server, then downloading those to the local file system. In short order, an attacker--or penetration tester--could quickly grab copies of many, if not all, PHP files on a Web server. Such files could contain sensitive information, such as "references to login credentials for databases, passwords, personally identifiable information, and a host of other goodies that [could] be sold on the black market or used to enable further exploits," said Camp.

"Now might be a good time to check your website configuration to make sure you're protected, before the bad guys go scouring around trying to use this type of exploit," said Camp. "If you're not the person in charge of your website, you might want to point out this problem to the person who is. They may thank you, a lot."

Your networks may be under attack as you read this, but unless your security personnel are analyzing logs and leveraging common tools that are well known to your network operations teams, you may not find out until it is too late. In our What's Going On?: Monitor Networks To Thwart Intrusions report, we explain how your security and network teams can cooperate and use common tools to detect threats before your databases are compromised. (Free registration required.)

Comment  | 
Print  | 
More Insights
Comments
Newest First  |  Oldest First  |  Threaded View
Navigating Security in the Cloud
Diya Jolly, Chief Product Officer, Okta,  12/4/2019
Register for Dark Reading Newsletters
White Papers
Video
Cartoon Contest
Current Issue
Navigating the Deluge of Security Data
In this Tech Digest, Dark Reading shares the experiences of some top security practitioners as they navigate volumes of security data. We examine some examples of how enterprises can cull this data to find the clues they need.
Flash Poll
Rethinking Enterprise Data Defense
Rethinking Enterprise Data Defense
Frustrated with recurring intrusions and breaches, cybersecurity professionals are questioning some of the industrys conventional wisdom. Heres a look at what theyre thinking about.
Twitter Feed
Dark Reading - Bug Report
Bug Report
Enterprise Vulnerabilities
From DHS/US-CERT's National Vulnerability Database
CVE-2019-16772
PUBLISHED: 2019-12-07
The serialize-to-js NPM package before version 3.0.1 is vulnerable to Cross-site Scripting (XSS). It does not properly mitigate against unsafe characters in serialized regular expressions. This vulnerability is not affected on Node.js environment since Node.js's implementation of RegExp.prototype.to...
CVE-2019-9464
PUBLISHED: 2019-12-06
In various functions of RecentLocationApps.java, DevicePolicyManagerService.java, and RecognitionService.java, there is an incorrect warning indicating an app accessed the user's location. This could dissolve the trust in the platform's permission system, with no additional execution privileges need...
CVE-2019-2220
PUBLISHED: 2019-12-06
In checkOperation of AppOpsService.java, there is a possible bypass of user interaction requirements due to mishandling application suspend. This could lead to local information disclosure no additional execution privileges needed. User interaction is not needed for exploitation.Product: AndroidVers...
CVE-2019-2221
PUBLISHED: 2019-12-06
In hasActivityInVisibleTask of WindowProcessController.java there?s a possible bypass of user interaction requirements due to incorrect handling of top activities in INITIALIZING state. This could lead to local escalation of privilege with no additional execution privileges needed. User interaction ...
CVE-2019-2222
PUBLISHED: 2019-12-06
n ihevcd_parse_slice_data of ihevcd_parse_slice.c, there is a possible out of bounds write due to a missing bounds check. This could lead to remote code execution with no additional execution privileges needed. User interaction is needed for exploitation.Product: AndroidVersions: Android-8.0 Android...