Talos Vulnerability Report

TALOS-2024-1974

Microsoft PowerPoint for macOS library injection vulnerability

August 19, 2024
CVE Number

CVE-2024-39804

SUMMARY

A library injection vulnerability exists in Microsoft PowerPoint 16.83 for macOS. A specially crafted library can leverage PowerPoint’s access privileges, leading to a permission bypass. A malicious application could inject a library and start the program to trigger this vulnerability and then make use of the vulnerable application’s permissions.

CONFIRMED VULNERABLE VERSIONS

The versions below were either tested or verified to be vulnerable by Talos or confirmed to be vulnerable by the vendor.

Microsoft PowerPoint 16.83 for macOS

PRODUCT URLS

PowerPoint - https://www.microsoft.com/en-us/microsoft-365/powerpoint

CVSSv3 SCORE

7.1 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N

CWE

CWE-347 - Improper Verification of Cryptographic Signature

DETAILS

Microsoft PowerPoint is a presentation software that is part of the Microsoft Office suite, designed to create engaging multimedia presentations with customized slides that can include text, images, video, and animations. It’s widely used for educational, business, and personal communication to visually convey information and ideas.

Microsoft PowerPoint loads multiple libraries through relative path:

$ otool -L "/Applications/Microsoft PowerPoint.app/Contents/MacOS/Microsoft PowerPoint"
/Applications/Microsoft PowerPoint.app/Contents/MacOS/Microsoft PowerPoint:
    @rpath/ADAL4.framework/Versions/A/ADAL4 (compatibility version 0.0.0, current version 0.0.0)
    @rpath/Chart.framework/Versions/A/Chart (compatibility version 0.0.0, current version 0.0.0)
    [...]
    /usr/lib/swift/libswiftAppKit.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/swift/libswiftFoundation.dylib (compatibility version 1.0.0, current version 1.0.0)

In this case the location is relative to the main executable /Applications/Microsoft PowerPoint.app/Contents/MacOS/Microsoft PowerPoint. Furthermore, PowerPoint has a big number of entitlements that allow the program to offer its various functionalities:

$ codesign -dv --entitlements -  "/Applications/Microsoft PowerPoint.app"
Executable=/Applications/Microsoft PowerPoint.app/Contents/MacOS/Microsoft PowerPoint
Identifier=com.microsoft.Powerpoint
Format=app bundle with Mach-O universal (x86_64 arm64)
CodeDirectory v=20500 size=280580 flags=0x10000(runtime) hashes=8757+7 location=embedded
Signature size=9012
Timestamp=12 Mar 2024 at 03:34:48
Info.plist entries=56
TeamIdentifier=UBF8T346G9
Runtime Version=14.2.0
Sealed Resources version=2 rules=13 files=10878
Internal requirements count=1 size=184
[Dict]
    [Key] com.apple.application-identifier
    [Value]
        [String] UBF8T346G9.com.microsoft.Powerpoint
    [Key] com.apple.developer.aps-environment
    [Value]
        [String] production
    [Key] com.apple.developer.team-identifier
    [Value]
        [String] UBF8T346G9
    [Key] com.apple.security.app-sandbox
    [Value]
        [Bool] true
    [Key] com.apple.security.application-groups
    [Value]
        [Array]
            [String] UBF8T346G9.Office
            [String] UBF8T346G9.ms
            [String] UBF8T346G9.com.microsoft.oneauth
            [String] UBF8T346G9.OfficeOsfWebHost
            [String] UBF8T346G9.OfficeOneDriveSyncIntegration
    [Key] com.apple.security.assets.movies.read-only
    [Value]
        [Bool] true
    [Key] com.apple.security.assets.music.read-only
    [Value]
        [Bool] true
    [Key] com.apple.security.assets.pictures.read-only
    [Value]
        [Bool] true
    [Key] com.apple.security.automation.apple-events
    [Value]
        [Bool] true
    [Key] com.apple.security.cs.allow-unsigned-executable-memory
    [Value]
        [Bool] true
    [Key] com.apple.security.cs.disable-library-validation
    [Value]
        [Bool] true
    [Key] com.apple.security.device.audio-input
    [Value]
        [Bool] true
    [Key] com.apple.security.device.camera
    [Value]
        [Bool] true
    [Key] com.apple.security.device.usb
    [Value]
        [Bool] true
    [Key] com.apple.security.files.bookmarks.app-scope
    [Value]
        [Bool] true
    [Key] com.apple.security.files.user-selected.read-write
    [Value]
        [Bool] true
    [Key] com.apple.security.network.client
    [Value]
        [Bool] true
    [Key] com.apple.security.personal-information.addressbook
    [Value]
        [Bool] true
    [Key] com.apple.security.personal-information.photos-library
    [Value]
        [Bool] true
    [Key] com.apple.security.print
    [Value]
        [Bool] true
    [Key] com.apple.security.scripting-targets
    [Value]
        [Dict]
            [Key] com.apple.mail
            [Value]
                [Array]
                    [String] com.apple.mail.compose
    [Key] com.apple.security.temporary-exception.apple-events
    [Value]
        [Array]
            [String] com.microsoft.outlook
    [Key] com.apple.security.temporary-exception.files.absolute-path.read-only
    [Value]
        [Array]
            [String] /Library/Preferences/com.microsoft.office.licensingV2.plist
            [String] /Library/Application Support/Microsoft/
    [Key] com.apple.security.temporary-exception.files.home-relative-path.read-only
    [Value]
        [Array]
            [String] /Library/Application Support/Microsoft/
    [Key] com.apple.security.temporary-exception.mach-lookup.global-name
    [Value]
        [Array]
            [String] com.microsoft.office.licensingV2.helper.port
    [Key] com.apple.security.temporary-exception.sbpl
    [Value]
        [Array]
            [String] (allow file-read* file-write* (require-all (vnode-type REGULAR-FILE) (regex #"(^|/)~\$[^/]+$")) )
            [String] (deny file-write* (subpath (string-append (param "_HOME") "/Library/Application Scripts")) (subpath (string-append (param "_HOME") "/Library/LaunchAgents")) )
    [Key] com.apple.security.temporary-exception.shared-preference.read-write
    [Value]
        [Array]
            [String] com.microsoft.autoupdate2
            [String] com.microsoft.office
            [String] com.microsoft.shared
    [Key] keychain-access-groups
    [Value]
        [Array]
            [String] UBF8T346G9.com.microsoft.identity.universalstorage

The program is compiled using the Hardened Runtime, a security feature which aims, among other things, to prevent dynamically linked library hijacking.
However, the program includes this specific entitlement:

[Key] com.apple.security.cs.disable-library-validation
[Value]
    [Bool] true

With this entitlement enabled, the program’s defense against library hijacking is effectively nullified, as it allows the loading of unsigned dynamic libraries. This is an issue because a malicious application could leverage PowerPoint’s permissions without proper authorization.

Indeed, an attacker could copy the application into a controllable location and perform a library injection to use the entitlements of the application. So, an attacker could potentially capture pictures, record audio, send emails through Microsoft Outlook, access the Pictures folder, exfiltrate data, and more.
In scenarios where the attacker leverages permissions already granted to PowerPoint, or when Apple Events are sent to the other Microsoft apps under the scope of the com.apple.security.temporary-exception.apple-events entitlement, the system will not display a pop-up permission prompt, executing actions straightaway.
However, in cases where the required permission hasn’t yet been granted, the Microsoft PowerPoint app will initiate the request. This could lead users to potentially grant the permission based on their trust in the Microsoft app.

Because of the use of the com.apple.security.cs.disable-library-validation entitlement set to true, a malicious application could perform a library injection in Microsoft PowerPoint without any special permission.

TIMELINE

2024-04-16 - Vendor Disclosure
2024-05-13 - Vendor reply
2024-07-29 - Feedback to vendor
2024-08-01 - Vendor reply and request for additional information
2024-08-06 - Vendor informed of CVE assignments
2024-08-14 - Vendor acknowledgement
2024-08-19 - Public Release

Credit

Discovered by Francesco Benvenuto of Cisco Talos.