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

PHP / FastCGI Installation Problem #2446

Closed
rnc opened this issue Jul 18, 2019 · 10 comments
Closed

PHP / FastCGI Installation Problem #2446

rnc opened this issue Jul 18, 2019 · 10 comments
Milestone

Comments

@rnc
Copy link
Contributor

rnc commented Jul 18, 2019

I installed the application through cpanel which gave me version 1.14.2.

I have been following https://freshrss.github.io/FreshRSS/en/users/06_Mobile_access.html to setup the system. However on running the API test I got:

Google Reader API configuration test:
    ❌ FAIL get HTTP Authorization header! Wrong Web server configuration.

From reading https://docs.holodyn.com/KnowledgeBase/Hosting/Apache/PHP_FastCGI_Authentication_Headers and https://www.drupal.org/project/restws/issues/2101361 I tried experimenting with adding to a .htaccess file.
Upon adding

RewriteCond %{HTTP:Authorization} ^(.+)
RewriteRule ^(.*)$ $1 [E=HTTP_AUTHORIZATION:%1,PT]

(from the above links) I got a pass. Unfortunately I don't know which directory needed the headers so have added it in the top level.

  • Where is best to add it?
  • Could this be supported internally if this is detected?
@Alkarex
Copy link
Member

Alkarex commented Jul 18, 2019

Hello,
There is already a .htaccess included, which is supposed to address your case:
https://github.com/FreshRSS/FreshRSS/blob/master/p/api/.htaccess
Please check that it is there

@rnc
Copy link
Contributor Author

rnc commented Jul 18, 2019

It is indeed there! I removed the above code from the top level and appended it to that file - and I still get a pass. So I guess the tests aren't working in my case.

@Alkarex I am not that familiar with htaccess conditionals but would be happy to help debug.

@rnc
Copy link
Contributor Author

rnc commented Jul 19, 2019

@Alkarex Having looked into this a bit more I've found the following references:

Experimenting more with the .htaccess I found that

	SetEnvIfNoCase "Authorization" "(.*)" HTTP_AUTHORIZATION=$1

works while

	SetEnvIfNoCase "^Authorization$" "(.*)" HTTP_AUTHORIZATION=$1

does not for me. Further simply adding

CGIPassAuth on

also works fine. If either of those two solutions are acceptable I'd be happy to send a PR

@Frenzie
Copy link
Member

Frenzie commented Jul 19, 2019

According to the link above you need at least 2.4.13 for the CGIPassAuth setting. Ubuntu 16.04 ships with Apache 2.4.18. However, Debian Jessie is still LTS supported for another year and it comes with 2.4.10. So presumably reducing the restrictions on the regex would be preferable for compatibility.

@Alkarex
Copy link
Member

Alkarex commented Jul 19, 2019

Thanks for the debugging @rnc
It would be interesting to find out why the current SetEnvIfNoCase rule does not work. Could you try to print the exact HTTP headers received?
For CGIPassAuth on (which would seem more proper), in addition of the increased minimum Apache version (which we could test), we must also be careful about about the different AllowOverride rights needed (AuthConfig, which is less commonly granted than FileInfo).

@Alkarex Alkarex added this to the 1.14.3 milestone Jul 19, 2019
@rnc
Copy link
Contributor Author

rnc commented Jul 19, 2019

Would anyone be actually be using 2.4.10 in reality as its vulnerable to multiple CVEs? Looking at my own hosting provider they have updated to 2.4.39. Alternatively is it feasible to use mod_version for now - and perhaps remove it in the long term ?

@Alkarex Can you give me any advice on how to do that - this is on my shared hosting account where I have limited access.

@Alkarex
Copy link
Member

Alkarex commented Jul 19, 2019

Linux distributions with long term maintenance provide security patches in older Apache / PHP / ... packages, so yes, people will most likely have old versions in production. See e.g. https://distrowatch.com/table.php?distribution=CentOS

For the HTTP headers at Apache level, would you happen to have / be able to install https://httpd.apache.org/docs/current/mod/mod_log_forensic.html ?

@Frenzie
Copy link
Member

Frenzie commented Jul 19, 2019

@rnc Debian backports security fixes.

https://www.debian.org/security/faq#oldversion

Specifics for Apache2 can be found here:
https://security-tracker.debian.org/tracker/source-package/apache2

@rnc
Copy link
Contributor Author

rnc commented Jul 19, 2019

@Alkarex Unfortunately because I reproduced the issue on a shared hosting account where I do not have root access I am not able to install things like that. As far as I can tell there is no way to do the equivalent of using wireshark to extract the headers.

rnc added a commit to rnc/FreshRSS that referenced this issue Jul 20, 2019
rnc added a commit to rnc/FreshRSS that referenced this issue Jul 20, 2019
Alkarex pushed a commit that referenced this issue Jul 20, 2019
* Issue #2446 : Fix passing authentication headers. Use CGIPassAuth is version is high enough

* Issue #2446 : Remove CGIPassAuth due to potential issues with AllowOverride rights.

* Tabs
@Alkarex
Copy link
Member

Alkarex commented Jul 20, 2019

#2449

@Alkarex Alkarex closed this as completed Jul 20, 2019
Alkarex added a commit that referenced this issue Jul 21, 2019
javerous pushed a commit to javerous/FreshRSS that referenced this issue Jan 20, 2020
* Issue FreshRSS#2446 : Fix passing authentication headers. Use CGIPassAuth is version is high enough

* Issue FreshRSS#2446 : Remove CGIPassAuth due to potential issues with AllowOverride rights.

* Tabs
javerous pushed a commit to javerous/FreshRSS that referenced this issue Jan 20, 2020
mdemoss pushed a commit to mdemoss/FreshRSS that referenced this issue Mar 25, 2021
* Issue FreshRSS#2446 : Fix passing authentication headers. Use CGIPassAuth is version is high enough

* Issue FreshRSS#2446 : Remove CGIPassAuth due to potential issues with AllowOverride rights.

* Tabs
mdemoss pushed a commit to mdemoss/FreshRSS that referenced this issue Mar 25, 2021
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

3 participants