Bug 2055326 (CVE-2022-24407)

Summary: CVE-2022-24407 cyrus-sasl: failure to properly escape SQL input allows an attacker to execute arbitrary SQL commands
Product: [Other] Security Response Reporter: Guilherme de Almeida Suckevicz <gsuckevi>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: anon.amish, aos-bugs, asoldano, atangrin, bbaranow, bdettelb, bmaxwell, brian.stansberry, caswilli, cdewolf, chazlett, crypto-team, darran.lofthouse, dhalasz, dkreling, dkuc, dosoudil, eleandro, fjansen, fj-lsoft-oss, fjuma, iweiss, jburrell, jjelen, jkoehler, jochrist, jpallich, jperkins, jwong, jwon, kaycoth, krathod, kwills, kyoshida, lgao, michal.skrivanek, micjohns, mperina, msochure, msvehla, nobody, nwallace, pjindal, pmackay, psegedy, rfreiman, rguimara, rstancel, rsvoboda, sbonazzo, security-response-team, smaestri, ssorce, sthirugn, tcarlin, tfister, tkasparek, tom.jenkinson, tsasak, vanmeeuwen+fedora, vkrizan, vkumar, vmugicag, yborgess
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: cyrus-sasl 2.1.28 Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in the SQL plugin shipped with Cyrus SASL. The vulnerability occurs due to failure to properly escape SQL input and leads to an improper input validation vulnerability. This flaw allows an attacker to execute arbitrary SQL commands and the ability to change the passwords for other accounts allowing escalation of privileges.
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-04-07 11:27:34 UTC Type: ---
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: 2055841, 2055842, 2055843, 2055844, 2055845, 2055846, 2055847, 2055848, 2057311, 2057312, 2057334, 2057447, 2059596, 2059600    
Bug Blocks: 2055327    

Description Guilherme de Almeida Suckevicz 2022-02-16 17:32:37 UTC
A SQL injection attack has been discovered in the SQL plugin shipped with Cyrus SASL 2.1.17 through 2.1.27 before 2.1.28. Due to failure to properly escape SQL input, an attacker can execute arbitrary SQL commands. This can allow, among other things, the ability to change the passwords for other accounts allowing escalation of privileges. The issue is in sql_auxprop_store, plugins/sql.c, and in particular the 5th parameter of sql_create_statement for the insert/update SQL command. Currently it takes the value of the property as is, without quoting. If one uses a password containing a closing ' and continues with valid SQL syntax, then exploitation is possible.

Comment 4 Simo Sorce 2022-02-21 18:43:45 UTC
Marian,
I think it is important to state that an "authenticated remote attacker" is needed, as this flaw occurs only on password change and I believe you need to be authenticated to perform it.

Comment 9 Sandipan Roy 2022-02-23 08:45:17 UTC
Created cyrus-sasl tracking bugs for this issue:

Affects: fedora-all [bug 2057334]

Comment 10 errata-xmlrpc 2022-02-23 20:01:29 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2022:0658 https://access.redhat.com/errata/RHSA-2022:0658

Comment 11 errata-xmlrpc 2022-02-24 10:20:11 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.4 Extended Update Support

Via RHSA-2022:0668 https://access.redhat.com/errata/RHSA-2022:0668

Comment 12 errata-xmlrpc 2022-02-24 10:22:07 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2022:0666 https://access.redhat.com/errata/RHSA-2022:0666

Comment 15 errata-xmlrpc 2022-03-02 14:16:59 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.1 Update Services for SAP Solutions

Via RHSA-2022:0730 https://access.redhat.com/errata/RHSA-2022:0730

Comment 16 errata-xmlrpc 2022-03-02 14:26:41 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8.2 Extended Update Support

Via RHSA-2022:0731 https://access.redhat.com/errata/RHSA-2022:0731

Comment 17 errata-xmlrpc 2022-03-08 16:11:28 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 6 Extended Lifecycle Support

Via RHSA-2022:0780 https://access.redhat.com/errata/RHSA-2022:0780

Comment 18 errata-xmlrpc 2022-03-14 09:23:16 UTC
This issue has been addressed in the following products:

  Red Hat Virtualization 4 for Red Hat Enterprise Linux 8

Via RHSA-2022:0841 https://access.redhat.com/errata/RHSA-2022:0841

Comment 19 errata-xmlrpc 2022-03-23 08:23:00 UTC
This issue has been addressed in the following products:

  RHINT Camel-K 1.6.4

Via RHSA-2022:1029 https://access.redhat.com/errata/RHSA-2022:1029

Comment 20 errata-xmlrpc 2022-04-07 09:03:27 UTC
This issue has been addressed in the following products:

  Red Hat Virtualization 4 for Red Hat Enterprise Linux 7

Via RHSA-2022:1263 https://access.redhat.com/errata/RHSA-2022:1263

Comment 21 Product Security DevOps Team 2022-04-07 11:27:31 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2022-24407