Skip to content
Access control Disclosed report Intermediate CVE-2018-3765

Improper protection of FileContentProvider

The FileContentProvider in the Nextcloud Android app checks whether the calling app's package name contains the string 'com.nextcloud.client' to decide if access is allowed. A malicious app with that substring in its package name could therefore access the provider without restriction, including reading private end-to-end encryption keys.

mmmds Follow

Originally disclosed on HackerOne

  • Triaged in 10 days
  • Fixed in 2 months
  • Paid in 54 days
  • Disclosed after 23 months

Some data in the FileContentProvider is protected against applications not related to NextCloud. The application checks if calling application package name contains "com.nextcloud.client" string. Every application with such substring in package name is allowed to fully access FileContentProvider.

com.owncloud.android.providers.FileContentProvider

Java
    private boolean isCallerNotAllowed() {
        String callingPackage = this.mContext.getPackageManager().getNameForUid(Binder.getCallingUid());
        return callingPackage == null || !callingPackage.contains(this.mContext.getPackageName());
    }

Impact

Malicious applications with "com.nextcloud.client" in their package names are able to access FileContentProvider without restrictions. For example they are able to read private keys to end-to-end encryption using URI: content://org.nextcloud/arbitrary_data

The original report as published on HackerOne, by mmmds. 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

The access control check uses a substring match on the caller's package name instead of verifying the caller's signature or exact package identity.

Impact

A malicious app with a crafted package name could read private end-to-end encryption keys and other data from the provider.

What the attacker needed

Malicious app installed on the device; app package name contains 'com.nextcloud.client'

The fix

The provider should verify the caller's identity using a strong mechanism such as signature-based permissions or an exact package name match.

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 share data with each other through components called content providers. This app tried to protect its provider by checking if the caller's package name contains a certain string, but that check is too loose: any app can choose a package name that includes that string. So a malicious app could pretend to be trusted and read sensitive files, such as encryption keys.

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 by mmmds

View all

1 more disclosed report, best first.

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.