Bug 2124547

Summary: Attempt to log in as "root" user with admin's password in Web UI does not properly fail
Product: Red Hat Enterprise Linux 9 Reporter: Ivan Brkic <ivan.brkic>
Component: ipaAssignee: Florence Blanc-Renaud <frenaud>
Status: CLOSED ERRATA QA Contact: Michal Polovka <mpolovka>
Severity: low Docs Contact:
Priority: unspecified    
Version: 9.0CC: abokovoy, gkaihoro, ivan.brkic, mjurasek, mpolovka, mrehak, pasik, rjeffman
Target Milestone: rcKeywords: Triaged, ZStream
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: ipa-4.10.0-8.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2127035 2137555 (view as bug list) Environment:
Last Closed: 2023-05-09 07:32:52 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:
Bug Depends On:    
Bug Blocks: 2127035, 2137555    

Description Ivan Brkic 2022-09-06 13:16:51 UTC
Description of problem:

The login page on Web UI for the Identity Management exhibits strange behaviour when attempting to log in as user "root" and password specified for the "admin" default administrator user.

When attempting to log in this way, the login attempt isn't denied as it should be but the Web UI goes into a loop of trying to log in and failing, displaying only a "Loading" box on a black background.


Version-Release number of selected component (if applicable):
ipa-server-4.9.8-7.el9_0.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Set up and install ip-server with ipa-server-dns component on a RHEL9 minimal install server.
2. Open a private browsing session of Firefox or Chrome (because the login attempt gets cached)
3. Attempt to log in to the ipa web UI with username "root" and password set for the "admin" user.


Actual results:
The login attempt does not fail. The page goes into a loop reloading the page, displaying a "Loading" box and no content. The attempted credentials are cached by the browser and any attempt to open the web page results in this loading loop. Closing the tab and going to the same URL results in the same "Loading" loop. Browser cache clearing is needed for the Web UI to display the login page.

Expected results:
Login attempt should fail with 
"The password or username you entered is incorrect"
since the "root" user does not exist in IdM/ipa

Additional info:
Bug does not appear in RHEL7 IdM login page.

I am initially flagging this as a security sensitive, since I don't know if this behaviour can potentially be used for something malicious. Feel free to remove the security flag if you don't find it to be a security vulnerability.

Comment 1 Alexander Bokovoy 2022-09-07 12:51:37 UTC
We have handled this in upstream publicly, so this bug can be unclassified.

It should be fixed in RHEL 8.7/9.1 once they are out as part of the rebases.

Comment 2 Florence Blanc-Renaud 2022-09-07 14:50:49 UTC
Upstream ticket:
https://pagure.io/freeipa/issue/9226

Comment 4 Florence Blanc-Renaud 2022-09-07 15:04:07 UTC
Note: the issue also happens on RHEL 8.6 but DOES NOT happen on RHEL 7.9 (it is related to the introduction of the patch https://pagure.io/freeipa/c/4911a3f05514a7c0ac66e4ef5004581cced8519f Prevent local account takeover which was backported to RHEL 8.6 but not to RHEL 7.9).

@security-response-team can you remove the Security keyword? The issue has already been discussed and fixed upstream.

Comment 7 Michal Polovka 2022-10-27 14:35:11 UTC
ipa-server-4.10.0-7.el9_1.x86_64

Admin password: Secret123
Root password: BananaBreadIsTheBest123 (see the difference in length)

Logged in as user root with admin's password (see the attached screenshot), therefore marking as pre-verified:tested. Automation in progress.

Comment 10 Michal Polovka 2022-11-09 11:45:27 UTC
Pre-verified using automation from ipatests/test_webui/test_loginscreen.py on RHEL9.2 machine with ipa-server-4.10.0-8.el9.x86_64

============================= test session starts ==============================
platform linux -- Python 3.6.8, pytest-3.10.1, py-1.11.0, pluggy-1.0.0 -- /usr/libexec/platform-python
cachedir: /home/cloud-user/.pytest_cache
metadata: {'Python': '3.6.8', 'Platform': 'Linux-4.18.0-372.32.1.el8_6.x86_64-x86_64-with-redhat-8.6-Ootpa', 'Packages': {'pytest': '3.10.1', 'py': '1.11.0', 'pluggy': '1.0.0'}, 'Plugins': {'metadata': '1.11.0', 'html': '1.22.1', 'multihost': '3.0', 'sourceorder': '0.6.0'}}
rootdir: /usr/lib/python3.6/site-packages/ipatests, inifile:
plugins: metadata-1.11.0, html-1.22.1, multihost-3.0, sourceorder-0.6.0
collecting ... collected 6 items

test_webui/test_loginscreen.py::TestLoginScreen::test_reset_password_view PASSED [ 16%]
test_webui/test_loginscreen.py::TestLoginScreen::test_reset_password_view_with_redirect PASSED [ 33%]
test_webui/test_loginscreen.py::TestLoginScreen::test_reset_password_view_with_delayed_redirect PASSED [ 50%]
test_webui/test_loginscreen.py::TestLoginScreen::test_reset_password_and_login_view PASSED [ 66%]
test_webui/test_loginscreen.py::TestLoginScreen::test_login_view PASSED  [ 83%]
test_webui/test_loginscreen.py::TestLoginScreen::test_root_login PASSED  [100%]


Full test log is an attachment of this BZ. Marking as pre-verified - tested.

Comment 14 Michal Polovka 2022-11-23 12:14:53 UTC
Tested with ipa-server-4.10.0-8.el9 on RHEL9.2 machine using the automation from test_webui/test_loginscreen.py::TestLoginScreen::test_root_login

============================= test session starts ==============================
platform linux -- Python 3.6.8, pytest-3.10.1, py-1.11.0, pluggy-1.0.0 -- /usr/libexec/platform-python
cachedir: /home/cloud-user/.pytest_cache
metadata: {'Python': '3.6.8', 'Platform': 'Linux-4.18.0-372.32.1.el8_6.x86_64-x86_64-with-redhat-8.6-Ootpa', 'Packages': {'pytest': '3.10.1', 'py': '1.11.0', 'pluggy': '1.0.0'}, 'Plugins': {'metadata': '1.11.0', 'html': '1.22.1', 'multihost': '3.0', 'sourceorder': '0.6.0'}}
rootdir: /usr/lib/python3.6/site-packages/ipatests, inifile:
plugins: metadata-1.11.0, html-1.22.1, multihost-3.0, sourceorder-0.6.0
collecting ... collected 6 items

test_webui/test_loginscreen.py::TestLoginScreen::test_reset_password_view PASSED [ 16%]
test_webui/test_loginscreen.py::TestLoginScreen::test_reset_password_view_with_redirect PASSED [ 33%]
test_webui/test_loginscreen.py::TestLoginScreen::test_reset_password_view_with_delayed_redirect PASSED [ 50%]
test_webui/test_loginscreen.py::TestLoginScreen::test_reset_password_and_login_view FAILED [ 66%]
test_webui/test_loginscreen.py::TestLoginScreen::test_login_view PASSED  [ 83%]
test_webui/test_loginscreen.py::TestLoginScreen::test_root_login PASSED  [100%]


The failure in unrelated test is caused by machine setup and it's not a regression.

Marking as verified.

Comment 16 errata-xmlrpc 2023-05-09 07:32:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (ipa bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:2205