CVE-2022-46179 (published 2022-12-28T08:15Z)

LiuOS is a small Python project meant to imitate the functions of a regular operating system. Version 0.1.0 and prior of LiuOS allow an attacker to set the GITHUB_ACTIONS environment variable to anything other than null or true and skip authentication checks. This issue is patched in the latest commit (c658b4f3e57258acf5f6207a90c2f2169698ae22) by requiring the var to be set to true, causing a test script to run instead of being able to login. A potential workaround is to check for the GITHUB_ACTIONS environment variable and set it to "" (no quotes) to null the variable and force credential checks.

CVSS v3 base score: 7.8, HIGH (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H)

Weakness information:
cwe_id: CWE-639
cwe_name: Authorization Bypass Through User-Controlled Key
description: The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data.
extended_description: 
            Retrieval of a user record occurs in the system based on some key value that is under user control. The key would typically identify a user-related record stored in the system and would be used to lookup that record for presentation to the user. It is likely that an attacker would have to be an authenticated user in the system. However, the authorization process would not properly check the data access operation to ensure that the authenticated user performing the operation has sufficient entitlements to perform the requested data access, hence bypassing any other authorization checks present in the system.
            For example, attackers can look at places where user specific data is retrieved (e.g. search screens) and determine whether the key for the item being looked up is controllable externally. The key may be a hidden field in the HTML form field, might be passed as a URL parameter or as an unencrypted cookie variable, then in each of these cases it will be possible to tamper with the key value.
            One manifestation of this weakness is when a system uses sequential or otherwise easily-guessable session IDs that would allow one user to easily switch to another user's session and read/modify their data.
         
         

Fix information:
repo_url: https://github.com/LiuWoodsCode/LiuOS
commit_details: repo_url: https://github.com/LiuWoodsCode/LiuOS
author: Liu Woods
author_date: 2022-12-27 14:04:46-05:00
msg: Fix authentication bypass exploit

Fixes the exploit by setting the requirement of the var to true, causing a side effect of the tests running, not the shell, making the exploit useless.
repository: repo_url: https://github.com/LiuWoodsCode/LiuOS
repo_name: LiuWoodsCode/LiuOS
description: A small Python project meant to imitate the functions of a regular operating system
repo_language: Python
owner: LiuWoodsCode
file_changes: filename: core.py
change_type: ModificationType.MODIFY
diff: @@ -112,7 +112,7 @@ else:
         if attemps == 6:
         ## Brute force protection
            raise Exception("Too many password attempts. Because of the risk of a brute force attack, after 6 attempts, you will need to rerun LiuOS to try 6 more times.")
-        if os.environ.get('GITHUB_ACTIONS') != "":
+        if os.environ.get('GITHUB_ACTIONS') == "true":
             logging.warning("Running on Github Actions")
             actualsys()
         elif username == cred.loginname and pwdreshash == cred.loginpass:

programming_language: Python