Skip to content
Access control Advisory Intermediate

GHSL-2022-046: Arbitrary Intent in WordPress for Android leads to read and write access

The exported EditPostActivity in WordPress for Android reflects the incoming Intent back to the caller, including URI permission grant flags. A malicious app on the same device could exploit this to gain read and write access to the app's non-exported FileProvider, which exposes external storage.

ghsecuritylab Follow

Originally disclosed on GitHub Security Lab

The WordPress for Android app has a security issue by which a malicious application installed on the same device can send it an arbitrary Intent that gets reflected back, unintentionally giving read and write access to non-exported Content Providers in WordPress for Android.

ghsecuritylab, on GitHub Security Lab

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

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 exported EditPostActivity returns the received Intent via setResult without sanitising or removing URI permission grant flags, allowing the caller to obtain permissions to the app's FileProvider.

Impact

A malicious app could use WordPress for Android as a proxy to read and write files on the device's external storage without requesting storage permissions, leading to privilege escalation.

What the attacker needed

Malicious app installed on same device; user interacts with the malicious app

The fix

The vulnerability was fixed in version 20.1.1 by addressing the Intent reflection issue.

How it was found

  1. Create an Intent targeting EditPostActivity with the necessary extras to avoid crashing.
  2. Add flags FLAG_GRANT_READ_URI_PERMISSION and FLAG_GRANT_WRITE_URI_PERMISSION to the Intent.
  3. Set the Intent data URI to the FileProvider path for external storage.
  4. Start the activity with startActivityForResult.
  5. When the user exits the activity, receive the reflected Intent in onActivityResult.
  6. Use the returned Intent's data URI to read and write files via the ContentResolver.

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.

In Android, apps can share data through components called Content Providers. Normally, an app can restrict access to its providers, but if it grants temporary permission via an Intent, other apps can access them. Here, a malicious app tricks WordPress into granting such permission by sending an Intent that WordPress later sends back, allowing the attacker to read and write files on the device's external storage.

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 ghsecuritylab

View all

132 more disclosed reports, best first.

More from GitHub Security Lab

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.