Skip to content
Access control Disclosed report Intermediate CVE-2022-24886

Notification implicit PendingIntent in com.nextcloud.client allows to access contacts

A download-complete notification in the Nextcloud Android app used an implicit PendingIntent, so a malicious app holding the notification-listener permission could obtain it and alter its package name and clip data. Because the notification ran with Nextcloud's identity, the attacker could read the victim's contacts and app log files without holding those permissions.

imnotyouaa_test Follow

Originally disclosed on HackerOne

Bounty$250 Low 1.3 View original
  • Triaged in 4 hours
  • Fixed in 10 months
  • Paid in 11 months
  • Disclosed after 13 months

Summary by the program

Advisory at https://github.com/nextcloud/security-advisories/security/advisories/GHSA-5cj3-v98r-2wmq

The report

When the victim downloads files in nextcloud.A notification will be triggered. The content of the notification is "Downloaded".This notification is used to remind the user that the download is complete.The pendingintent in this notification is an implicit intent.

At this time a malicious app with "BINDNOTIFICATIONLISTENER_SERVICE" permission can get the pendintent of this notification, because it is an implicit pendintent. Therefore, the malicious app can set the "packageName" and "clipdata" of this pendintent. At this time, the malicious application will inherit the permissions of "com.nextcloud.client".Because nextcloud has contacts permissions. Therefore, malicious applications can read the contacts without applying for the contacts permission.

contacts.png
contacts.png From the original on HackerOne

At the same time, because of the path configuration of fileprovider, the log file in the nextcloud app directory can also be read

filepath.png
filepath.png From the original on HackerOne

The code of this implicit pendingintent is in "com.owncloud.android.files.services.FileDownloader.notifyDownloadResult(com.owncloud.android.operations.DownloadFileOperation, com.owncloud.android.lib.common.operations.RemoteOperationResult) : void"

pendingintent.png
pendingintent.png From the original on HackerOne

Steps To Reproduce: packageName:com.nextcloud.client versionName:3.15.1 phone:pixel3 AndroidVersion:10

1.install and run "poc.apk" 2.click the button to give the "BINDNOTIFICATIONLISTENER_SERVICE" permission to poc 3.install "com.nextcloud.client.apk" and give contacts permission to nextcloud. 4.Download a file as shown in the video.At this time, the victim's app will trigger a notification 5.run "adb logcat | grep sbn". now you can see the contact stolen by the attacker

Supporting Material/References: 1.read contacts poc video

nextcloud.mov From the original on HackerOne

2.poc.apk (Attachment on the original report: poc.apk)

3."com.nextcloud.client.apk" (Attachment on the original report: com.nextcloud.client_3.15.1-30150190_minAPI21(arm64-v8a_armeabi-v7a_x86_x86_64)(nodpi)_apkmirror.com.apk)

Impact

Any application with notification permission can steal contacts without apply for the contacts permission To fix this vulnerability, please set the flag of pengingintent to FLAG_IMMUTABLE

The original report as published on HackerOne, by imnotyouaa_test. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the download notification built its PendingIntent as an implicit intent without the immutable flag, so a notification listener could retrieve and rewrite it.

Impact

A malicious app with notification-listener access could read the victim's contacts and the app's log files without holding those permissions, though the attack depends on the user granting that listener access and Nextcloud already holding contacts permission.

What the attacker needed

Attacker app with notification listener access; Nextcloud app holds contacts permission; victim downloads a file

The fix

The PendingIntent should be made immutable so other apps cannot retrieve or modify it.

How it was found

  1. Install and run the proof-of-concept app.
  2. Grant the proof-of-concept app the notification listener permission.
  3. Install the Nextcloud app and give it contacts permission.
  4. Download a file so the victim app posts the notification.
  5. Read the device log to see the contacts the attacker obtained.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Android apps can post notifications, and a notification can carry a PendingIntent, which is a pre-packaged action another app is allowed to trigger later. If that action is not locked down, a hostile app that is allowed to read notifications can grab it and change where it points, so the action runs as the Nextcloud app with Nextcloud's permissions. That let the attacker read contacts and log files without ever asking the user for those permissions.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More from Nextcloud

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.