Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggest Updating Sample Apache Configuration in readme.md #1106

Closed
kbecker43 opened this issue Apr 27, 2018 · 0 comments
Closed

Suggest Updating Sample Apache Configuration in readme.md #1106

kbecker43 opened this issue Apr 27, 2018 · 0 comments

Comments

@kbecker43
Copy link

The readme contains a sample Apache Configuration:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule .* index.php [L,QSA]

See https://github.com/bcosca/fatfree#sample-apache-configuration

I'm suggesting this be updated to the Apache config that's actually used in F3:

# Enable rewrite engine and route requests to framework
RewriteEngine On

# Some servers require you to specify the `RewriteBase` directive
# In such cases, it should be the path (relative to the document root)
# containing this .htaccess file
#
# RewriteBase /

RewriteRule ^(tmp)\/|\.ini$ - [R=404]

RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L,QSA]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

The reason being that using the paired down sample apache config in the readme is missing the RewriteRule ^(tmp)\/|\.ini$ - [R=404] which could leave a server open to having .ini files accessible exposing your routes and any variables (which could potentially include database or other credentials).

ikkez added a commit that referenced this issue Sep 14, 2018
@ikkez ikkez closed this as completed Sep 14, 2018
cbayona added a commit to cbayona/fatfree that referenced this issue Oct 5, 2018
extend sample apache config, bcosca#1106
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants