Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 891791 (CVE-2023-22741, CVE-2023-32307) - <net-libs/sofia-sip-1.13.16: multiple heap mishandling vulnerabilities
Summary: <net-libs/sofia-sip-1.13.16: multiple heap mishandling vulnerabilities
Status: CONFIRMED
Alias: CVE-2023-22741, CVE-2023-32307
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Gentoo Security
URL: https://github.com/freeswitch/sofia-s...
Whiteboard: B1 [stable]
Keywords:
Depends on: 915666
Blocks:
  Show dependency tree
 
Reported: 2023-01-22 23:51 UTC by John Helmert III
Modified: 2023-12-31 09:01 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2023-01-22 23:51:59 UTC
CVE-2023-22741:

Sofia-SIP is an open-source SIP User-Agent library, compliant with the IETF RFC3261 specification. In affected versions Sofia-SIP **lacks both message length and attributes length checks** when it handles STUN packets, leading to controllable heap-over-flow. For example, in stun_parse_attribute(), after we get the attribute's type and length value, the length will be used directly to copy from the heap, regardless of the message's left size. Since network users control the overflowed length, and the data is written to heap chunks later, attackers may achieve remote code execution by heap grooming or other exploitation methods. The bug was introduced 16 years ago in sofia-sip 1.12.4 (plus some patches through 12/21/2006) to in tree libs with git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3774 d0543943-73ff-0310-b7d9-9358b9ac24b2. Users are advised to upgrade. There are no known workarounds for this vulnerability.

Patch, in 1.13.11: https://github.com/freeswitch/sofia-sip/commit/da53e4fbcb138b080a75576dd49c1fff2ada2764
Comment 1 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2023-05-27 20:28:28 UTC
CVE-2023-32307 (https://github.com/freeswitch/sofia-sip/security/advisories/GHSA-rm4c-ccvf-ff9c):

Sofia-SIP is an open-source SIP User-Agent library, compliant with the IETF RFC3261 specification.
Referring to [GHSA-8599-x7rq-fr54](https://github.com/freeswitch/sofia-sip/security/advisories/GHSA-8599-x7rq-fr54), several other potential heap-over-flow and integer-overflow in stun_parse_attr_error_code and stun_parse_attr_uint32 were found because the lack of attributes length check when Sofia-SIP handles STUN packets. The previous patch of [GHSA-8599-x7rq-fr54](https://github.com/freeswitch/sofia-sip/security/advisories/GHSA-8599-x7rq-fr54) fixed the vulnerability when attr_type did not match the enum value, but there are also vulnerabilities in the handling of other valid cases. The OOB read and integer-overflow made by attacker may lead to crash, high consumption of memory or even other more serious consequences. These issue have been addressed in version 1.13.15. Users are advised to upgrade.
Comment 2 Larry the Git Cow gentoo-dev 2023-10-07 06:07:21 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6d35a3a78373c711a2b940a9c5a745c64c8cebaa

commit 6d35a3a78373c711a2b940a9c5a745c64c8cebaa
Author:     Hans de Graaff <graaff@gentoo.org>
AuthorDate: 2023-10-07 06:05:59 +0000
Commit:     Hans de Graaff <graaff@gentoo.org>
CommitDate: 2023-10-07 06:07:02 +0000

    net-libs/sofia-sip: add 1.13.16
    
    Bug: https://bugs.gentoo.org/891791
    Signed-off-by: Hans de Graaff <graaff@gentoo.org>

 net-libs/sofia-sip/Manifest                 |  1 +
 net-libs/sofia-sip/sofia-sip-1.13.16.ebuild | 44 +++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+)
Comment 3 Hans de Graaff gentoo-dev Security 2023-12-28 14:21:34 UTC
The stable bug for this is running into all kinds of issues on different arches. With net-voip/telepathy-rakia the only reverse dependency and also being maintainer-needed perhaps we are better off treecleaning both packages.