Giter Site home page Giter Site logo

Add `TraceEnable` about server-configs-apache HOT 9 CLOSED

h5bp avatar h5bp commented on May 19, 2024
Add `TraceEnable`

from server-configs-apache.

Comments (9)

XhmikosR avatar XhmikosR commented on May 19, 2024 1

Can someone make a PR?

from server-configs-apache.

efes0 avatar efes0 commented on May 19, 2024

last i heard to be pci compliant you need to set TraceEnable off

for some reason we also had to set the following

RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* <96> [F]

from server-configs-apache.

AD7six avatar AD7six commented on May 19, 2024

πŸ‘

from server-configs-apache.

alrra avatar alrra commented on May 19, 2024

From https://httpd.apache.org/docs/current/mod/core.html#TraceEnable

Despite claims to the contrary, TRACE is not a security vulnerability and there is no viable reason for it to be disabled. Doing so necessarily makes your server non-compliant.

@mathiasbynens Can you provide more details on why this should be done? Thanks!

from server-configs-apache.

efes0 avatar efes0 commented on May 19, 2024

this is a bit old but if it still holds true...

https://bugzilla.redhat.com/show_bug.cgi?id=463940

http://www.apacheweek.com/issues/03-01-24#news

from server-configs-apache.

mathiasbynens avatar mathiasbynens commented on May 19, 2024

As the docs say:

The default TraceEnable on permits TRACE requests per RFC 2616, which disallows any request body to accompany the request. TraceEnable off causes the core server and mod_proxy to return a 405 (Method not allowed) error to the client.

There is no reason to allow TRACE HTTP requests on a production website.

From https://httpd.apache.org/docs/current/mod/core.html#TraceEnable

Despite claims to the contrary, TRACE is not a security vulnerability and there is no viable reason for it to be disabled. Doing so necessarily makes your server non-compliant.

Note that per RFC 2616, support for HTTP TRACE is OPTIONAL: http://tools.ietf.org/html/rfc2616#section-5.1.1 So it is perfectly compliant to disable it.

from server-configs-apache.

alrra avatar alrra commented on May 19, 2024

@efes0, @mathiasbynens Thanks for your comments!

from server-configs-apache.

ryran avatar ryran commented on May 19, 2024

For the record (and for future search-engine users stumbling across this), the original HTTP/1.1 RFC2616 mentioned above by @mathiasbynens was superceded in 2014 by a collection of updated HTTP/1.1 RFCs.

That said, his point about TRACE being optional still holds of course. Here's the updated link and verbiage -- i.e., from RFC7231's Overview of Methods:

This specification defines a number of standardized methods that are
commonly used in HTTP, as outlined by the following table.
...
All general-purpose servers MUST support the methods GET and HEAD.
All other methods are OPTIONAL.

from server-configs-apache.

Malvoz avatar Malvoz commented on May 19, 2024

The OWASP documentation on:

Cross-Site Tracing (XST) suggests that:

Modern browsers now prevent TRACE requests being made via JavaScript, however, other ways of sending TRACE requests with browsers have been discovered, such as using Java.

In Test HTTP methods:

HTTP offers a number of methods that can be used to perform actions on the web server. Many of theses methods are designed to aid developers in deploying and testing HTTP applications. These HTTP methods can be used for nefarious purposes if the web server is misconfigured.

... methods that should be disabled are the following:

PUT: ... An attacker can exploit it by uploading malicious files.

DELETE: This method allows a client to delete a file on the web server. An attacker can exploit it as a very simple and direct way to deface a web site or to mount a DoS attack.

CONNECT: This method could allow a client to use the web server as a proxy.

TRACE: ... This method, originally assumed harmless, can be used to mount an attack known as Cross Site Tracing.

And in Testing for HTTP Verb Tampering:

As long as the web application being tested does not specifically call for any non-standard HTTP methods, testing for HTTP verb tampering is quite simple. If the server accepts a request other than GET or POST, the test fails. The solutions is to disable all non GET or POST functionality within the web application server, or in a web application firewall.

This issue is focusing solely on TRACE, however if methods other than GET and POST are deemed safe to disallow entirely: Just send a 405 Method Not Allowed for everything else?

E.g:

RewriteEngine On
RewriteCond %{REQUEST_METHOD} !^(GET|POST) [NC]
RewriteRule .* - [R=405,L]

from server-configs-apache.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.