CVE-2022-31009 (published 2022-06-23T07:15Z)

wire-ios is an iOS client for the Wire secure messaging application. Invalid accent colors of Wire communication partners may render the iOS Wire Client partially unusable by causing it to crash multiple times on launch. These invalid accent colors can be used by and sent between Wire users. The root cause was an unnecessary assert statement when converting an integer value into the corresponding enum value, causing an exception instead of a fallback to a default value. This issue is fixed in [wire-ios](https://github.com/wireapp/wire-ios/commit/caa0e27dbe51f9edfda8c7a9f017d93b8cfddefb) and in Wire for iOS 3.100. There is no workaround available, but users may use other Wire clients (such as the [web app](https://app.wire.com)) to continue using Wire, or upgrade their client.

Severity: MEDIUM
CVSS v2 base score: 4.0 (AV:N/AC:L/Au:S/C:N/I:N/A:P)
CVSS v3 base score: 6.5, MEDIUM (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H)

Weakness information:
cwe_id: CWE-617
cwe_name: Reachable Assertion
description: The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.
extended_description: 
            While assertion is good for catching logic errors and reducing the chances of reaching more serious vulnerability conditions, it can still lead to a denial of service.
            For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.
         
         

Fix information:
repo_url: https://github.com/wireapp/wire-ios
commit_details: repo_url: https://github.com/wireapp/wire-ios
author: John Nguyen
author_date: 2022-05-10 15:08:34+02:00
msg: chore: remove unnecessary assert SQCORE-1299 (#5660)

* chore: remove unnecessary assert

* empty
repository: repo_url: https://github.com/wireapp/wire-ios
repo_name: wireapp/wire-ios
description: 📱 Wire for iOS (iPhone and iPad)
repo_language: Swift
owner: wireapp
file_changes: filename: ColorScheme.swift
change_type: ModificationType.MODIFY
diff: @@ -19,6 +19,7 @@
 import Foundation
 import UIKit
 import WireUtilities
+import WireCommonComponents
 
 @objc
 enum ColorSchemeVariant: UInt {
@@ -318,14 +319,11 @@ extension UIColor {
 
     /// Creates UIColor instance with color corresponding to @p accentColor that can be used to display the name.
     class func nameColor(for accentColor: ZMAccentColor, variant: ColorSchemeVariant) -> UIColor {
-
-        assert(accentColor.rawValue <= ZMAccentColor.max.rawValue)
-
+        let accentColor = AccentColor(ZMAccentColor: accentColor) ?? .strongBlue
         let coefficientsArray = variant == .dark ? accentColorNameColorBlendingCoefficientsDark : accentColorNameColorBlendingCoefficientsLight
         let coefficient = coefficientsArray[Int(accentColor.rawValue)]
-
         let background: UIColor = variant == .dark ? .black : .white
-        return background.mix(UIColor(fromZMAccentColor: accentColor), amount: coefficient)
+        return background.mix(UIColor(for: accentColor), amount: coefficient)
     }
 }
 

programming_language: Swift