OSI Security - Penetration Testing & Web Application Security Consultants
  • Home
  • Try
  • Pricing
  • Services
    • Managed Monthly Penetration Testing Service
    • Managed Quarterly Penetration Testing Service
    • Email Security Review
    • Request a quote for Penetration Testing
    • Bug Bounty Penetration Test
    • Remote Support
  • Solutions
  • Company
    • Advisories
    • Customers
    • News and Press Releases
    • Blog
    • Contact
    • Careers
  • Home
  • Try
  • Pricing
  • Services
    • Managed Monthly Penetration Testing Service
    • Managed Quarterly Penetration Testing Service
    • Email Security Review
    • Request a quote for Penetration Testing
    • Bug Bounty Penetration Test
    • Remote Support
  • Solutions
  • Company
    • Advisories
    • Customers
    • News and Press Releases
    • Blog
    • Contact
    • Careers

Apache mod_speling HTTP Referrer Cross-site scripting vulnerability

Release Date: 
20-09-2017

Software: 
Apache HTTP Server

Versions tested:
Apache http server 2.4.27 stable. 


Vulnerability discovered: 

Reflected Cross-site Scripting in mod_speling module.

Vulnerability impact: 

Low.

Vulnerability information:

The Apache HTTP Server ships with an optional module named mod_speling. The name mod_speling is intentionally misspelt, as the package provides a friendly HTTP error message when a website visitor requests a URL page name which does not exist, but potential spelling alternatives are available (such as asking for indexs.html which is not found, while index.html exists). The mod_speling module will suggest the valid alternative of index.html, or provide a hyperlink to go back to the referring page and report this dead hyperlink to the website author. The vulnerability exists where the requested page name does not exist, and a correctly spelled page is present, where malicious javascript input is used in the HTTP 'Referrer' header. The source code uses the Apache escape_uri() method, which correctly escapes URL hyperlinks but does not safely encode HTML input such as : and / which would be used in a URL. Cross-site scripting is executed when a visitor clicks on the Apache generated hyperlink.

https://github.com/apache/httpd/blob/trunk/modules/mappers/mod_speling.c#L486
"<a href=\"";
*(const char **)apr_array_push(t) = ap_escape_uri(sub_pool, ref);
*(const char **)apr_array_push(t) = "\">referring page</a> "
"about the broken link.\n";


Example: 

GET /indexs.html HTTP/1.0
Referer: javascript:alert(document.cookie)/foo


Recommendation: 

The source code has since been patched to use the ap_escape_html() function instead. Future stable releases will contain this fix e.g. 2.4.28 stable

Workaround: 

N/A. 

Credit: 
This vulnerability was disclosed by Patrick Webster. 

Disclosure timeline: 
18-Sep-2017 - Discovered during audit. Reported to Apache Security Team. Report acknowledged.
19-Sep-2017 - Source code patched.
20-Sep-2017 - Disclosure.

About OSI Security: 

OSI Security is an independent network and computer security auditing 
and consulting company based in Sydney, Australia. We provide internal 
and external penetration testing, vulnerability auditing and wireless 
site audits, vendor product assessments, secure network design, 
forensics and risk mitigation services. 

We can be found at http://www.osisecurity.com.au/ ​
NSW Government ICT Services (SCM0020) approved supplier
OSI Security is an approved supplier to the Victorian Government
OSI Security is an approved supplier to the Queensland Government
OSI Security is an approved supplier to the New Zealand Government
Picture
External Penetration Testing
Managed Security Services
​Source Code Review
Web Application Security Testing
Firewall Configuration and Rulesets
WiFi Access Point and Client Auditing
Forensics and Data Recovery
System Hardening and Configuration
Metasploit Pro
Tenable Nessus
Acunetix Web Scanner
Nexpose Vulnerability
Secunia Software Inspection
Elcomsoft Password Cracking
PortSwigger BurpSuite
HP Fortify
 
Contact
Clients
Advisories
Privacy policy
​
Ethics Statement
Disclosure Policy
OSI SECURITY ACN 144 579 751 © 2010 - 2025.
​ALL RIGHTS RESERVED. SYDNEY, AUSTRALIA.
Join newsletter

Picture

OSI Security is proud to support a number of recognised charities, development projects and industry groups...

The Australian Computer Museum Society Incorporated
Hackers Helping Hackers
sqlmap.org
Metasploit Framework
2600-AU Australia