Quantcast
Channel: eternal-todo.com aggregator
Viewing all articles
Browse latest Browse all 12054

SANS Internet Storm Center, InfoCON: green: HTTP Headers... the Achilles' heel of many applications, (Fri, May 5th)

$
0
0

When browsing a target web application, a pentester is looking for all entry or injection points present in the pages. Everybody knows that a static website padding:5px 10px"> form action=/view.php method=post input name=article id=article input type=submit value=Submit /form

In both cases, the pentester will have a deeper look at the values that can be passed to the article parameter.

But, there are alternative ways to interact with a website. Today, modern sites have multiple versions available. Depending on the visitors browser, a mobile or light version of the website can be returned, optimised for mobile phones or tablets. Some websites react in different ways just based on the User-Agent passed by the browser. Chris John Riley developed a few years ago a nice script that I padding:5px 10px"> $ ./ua-tester.py -u www.company.com -f my-useragents.txt -v

The HTTP referrer is also a very nice way to abuse some websites. A few years ago, I remember a Belgian newspaperwhich granted access to paid content based on the referrer! The HTTP headers passed in every HTTP requests are also a good source of vulnerabilities. We have a new example with two Wordpress vulnerabilities released this week:CVE-2017-8295[2] and a second one based on CVE-2016-10033[3].

The first affect the password reset feature provided by Wordpress (up to version 4.7.4). It might allow an attacker to get the password reset link sent via email and use it to compromise the user account then have more access to the Wordpress site. The second one has been discovered in 2016 but disclosed two days ago. This one affects thePHPMailer mailer component of Wordpress core 4.6. The Wordpress development team initially reported as not affected by the bug discovered in 2016. They are interesting because both are vulnerable to the injection of malicious data through HTTP headers. Many web servers (Apache included) set the SERVER_NAME variable using the hostname supplied by the client.

Keep in mind: When you read ... supplied by the client, you must understand: ... that can be altered or poisoned by the client padding:5px 10px"> if ( !isset( $from_email ) ) { $sitename = strtolower( $_SERVER[SERVER_NAME if ( substr( $sitename, 0, 4 ) == www. } $from_email = wordpress@ }

Wordpress just uses theHost: HTTP header provided by the client padding:5px 10px"> http://www.company.com/shop/view.php?article=1234%0D%0ASet-Cookie%3A%20MyCookie=pwn3d

In the padding:5px 10px"> HTTP/1.1 302 Object moved Connection: close Location: search.php?article=1234 Set-Cookie: MyCookie=pwn3d Content-Length: 105

Those attacks are not new, most of them are known for years but are still relevant today. Also, think outside HTTP. Most protocols use headers that might be abuse. A good example was Postfix in 2014 which was vulnerable to the ShellShock attack via SMTP headers[4].

The Top-10 OWASP project keeps injection (of any kind) as the first security issue since 2010[5]. They also have a project called Secure Headers Project which address this problem[6]. To resume, never trust data coming from the client side!

[1]https://packetstormsecurity.com/files/94305/UA-Tester-User-Agent-Tester-1.03.html
[2]https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8295
[3]https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-10033
[4]https://www.exploit-db.com/exploits/34896/
[5]https://github.com/OWASP/Top10/raw/master/2017/OWASP%20Top%2010%20-%202017%20RC1-English.pdf
[6]https://www.owasp.org/index.php/OWASP_Secure_Headers_Project

Xavier Mertens (@xme)
ISC Handler - Freelance Security Consultant
PGP Key

(c) SANS Internet Storm Center. https://isc.sans.edu Creative Commons Attribution-Noncommercial 3.0 United States License.

Viewing all articles
Browse latest Browse all 12054

Latest Images

Trending Articles



Latest Images