Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2189266

Summary: get "you don't have permission to access" error when trying to access files with spaces in them
Product: Red Hat Enterprise Linux 7 Reporter: Brian Johnson <mbjohn>
Component: httpdAssignee: Luboš Uhliarik <luhliari>
Status: CLOSED MIGRATED QA Contact: rhel-cs-infra-services-qe <rhel-cs-infra-services-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.9CC: jorton, luhliari
Target Milestone: rcKeywords: MigratedToJIRA
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-21 19:06:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Brian Johnson 2023-04-24 15:16:08 UTC
Description of problem:
When trying to access a file that has a space in it, get "you don't have permission to access" Forbidden message even though the file name is properly formatted in the URL (with %20 in the place of spaces)

Version-Release number of selected component (if applicable):
2.4.6-98.el7_9.7.x86_64

How reproducible:
Consistently

Steps to Reproduce:
1.create 'file with a space.txt' in web accessible directory
2.go to https://<sitename>/file%20with%20a%20space.txt
3. get Forbidden error message

Actual results:
Forbidden: You don't have permission to access <file>

Expected results:
Access to file granted

Additional info:
Permissions have been checked on the directory on the server. Was able to copy the file to a name without spaces and had no issues getting to the file. Copied it to a different name with spaces and got forbidden error. Our customer who reported the issue said they didn't have problems prior (many of their files they use regularly have spaces in the name) and I checked and found that apache got updated last Thursday. Rolled back the upgrade to 2.4.6-98.el7_9.6 and no longer had an issue getting to the files

Comment 3 Brian Johnson 2023-05-17 14:39:42 UTC
Hi -- I was wondering if there is any movement on this issue. We have a customer who currently has to have apache versionlocked to deal with this problem, making their server vulnerable with an older version of apache. thanks.

Comment 4 Joe Orton 2023-06-27 15:19:43 UTC
Brian, can you file a customer ticket for it? It would help expedite it.

Comment 5 Brian Johnson 2023-06-27 17:44:32 UTC
hey Joe, no problem at all, I'll be glad to!
 
Case 03548836 has been submitted (https://access.redhat.com/support/cases/#/case/03548836)

Comment 6 Luboš Uhliarik 2023-07-11 10:04:23 UTC
Hello Brian,

have you tried newer package than httpd-2.4.6-98.el7_9.7.x86_64 ?

Comment 7 Brian Johnson 2023-07-11 16:07:01 UTC
(In reply to Luboš Uhliarik from comment #6)
> Hello Brian,
> 
> have you tried newer package than httpd-2.4.6-98.el7_9.7.x86_64 ?

Hi Luboš!

I did some testing for my support ticket with Red Hat and when I did the testing I was updating to 2.4.6-99.el7_9.1. The issue was still prevalent there. As it turns out, the person I was working with at Red Hat pointed me to https://access.redhat.com/solutions/7016850 which provided the explanation and the fix -- 

---
Root Cause
This is a change in behavior from the CVE-2023-25690 fix. The rewrite rule results in mod_rewrite seeing characters in the URI as a plain ' ' and the update rejects such a character for protection.

Resolution
Add the B flag to a proxy rewrite using a back reference to add a query string parameter to ensure any space or special character is escaped, for example:

RewriteRule "^/(.*)" "http://localhost:8080/app?param=$1" [P,L,QSA,B]

---

On the server we were having issues with, there was a line,

RewriteRule ^(.+)$ index.php?path=$1&%{QUERY_STRING} [L]

that was apparently causing the issue. By changing the line to:

RewriteRule ^(.+)$ index.php?path=$1&%{QUERY_STRING} [L,B]

Users were then able to download the files with spaces in them correctly. I believe this properly takes care of the issue.

Comment 8 RHEL Program Management 2023-09-21 18:52:18 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 9 RHEL Program Management 2023-09-21 19:06:14 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.