Path traversal in deeplink query parameter can expose any user's private info to a public directory (one click)
The Basecamp Android app accepts a filename parameter on a deeplink and uses it to decide where to save a downloaded file, without sanitising the path. An attacker could craft a link that makes the app write the user's private report into a shared storage folder that other apps can read.
- Triaged in 4 days
- Fixed in 22 days
- Paid in 4 days
- Disclosed after 23 days
[------------------------------------Package Details---------------------------------------]:
| Application Name :Basecamp
| Package Name :com.basecamp.bc3
| Version code :380
| Version Name :4.8.6
| Mimimum SDK :28
| Target SDK :34
| Max SDK :None
| Sha256 :124861dde5cbb9a38d0994c3ca994fbbe5bae83b79621b7e476a0aa78bb711f2
[------------------------------------------------------------------------------------------]
Summary
It was found that the basecamp.bc3 app can be forced to expose the user's private info (any), to the device's shared directory which is accessible by any 3p app with READ/MANAGE external storage permissions.
Technical details
The application declares to its android manifest that it handles deeplinks of the form: https://3.basecamp.com/* . The particular deeplink can "take" an additional parameter, called "filename" which is used by the app to save the file locally. By using a textbook path traversal exploit, it is possible to force the app to save the file to any directory, including ones which are shared and thus accessible by 3rd party apps.
Steps to reproduce
The following link stores the user's progress report to the /sdcard/Download/disclosure.txt file:
<a href="https://3.basecamp.com/5195267/reports/progress?filename=/../../../../../../../../../../sdcard/Download/disclosure.txt">click me</a>
Since basecamp supports link within comments/projects e.t.c. , it is possible to add a malicious link, literally anywhere:
Impact
An attacker can send/add a malicious link which can expose user's private and files to 3rd party entities.
Context
Basecamp ships an Android client under the package name com.basecamp.bc3. The app registers a deeplink handler for URLs of the form https://3.basecamp.com/*, so links that point at a Basecamp project, report or other resource open inside the app rather than in a browser. One of the things the app does with such a deeplink is save a file locally: the link can carry an extra filename parameter that tells the app where to write the file on the device.
The report shows that this filename value is used without sanitisation, so a crafted link can walk out of the intended directory and drop the file into a shared location on external storage. From there any third-party app holding READ or MANAGE external storage permissions can read it.
Setup
The testing was done against the following build of the Android application:
[------------------------------------Package Details---------------------------------------]:
| Application Name :Basecamp
| Package Name :com.basecamp.bc3
| Version code :380
| Version Name :4.8.6
| Mimimum SDK :28
| Target SDK :34
| Max SDK :None
| Sha256 :[redacted]
[------------------------------------------------------------------------------------------]
Finding it
The starting point is the manifest declaration: the app handles deeplinks of the form https://3.basecamp.com/*. The interesting part is that a particular deeplink accepts an additional parameter called filename, which the app uses to decide where to save the file locally. A parameter that is taken from a URL and then used as a filesystem path is exactly the shape of a path traversal bug, so the researcher tested whether ../ sequences in that value are honoured.
Exploitation
Step 1: build the malicious deeplink
The link below points at a progress report and supplies a filename value containing a long run of ../ segments followed by a target path on shared storage:
<a href="https://3.basecamp.com/5195267/reports/progress?filename=/../../../../../../../../../../sdcard/Download/disclosure.txt">click me</a>
The filename query parameter is the injection point: the repeated ../ segments climb out of the intended directory and the value ends in sdcard/Download/disclosure.txt. When the link is opened, the app saves the user's progress report to /sdcard/Download/disclosure.txt.
Step 2: deliver the link
Because Basecamp renders links inside comments, projects and similar content, the malicious link can be placed almost anywhere a link is accepted. The recording shows the link being used in that context:
The video, Screen_Recording_2024-06-16_at_08.58.13.mov, accompanies the step where the link is placed in Basecamp content.
Root cause
The app takes the filename query parameter from an externally supplied deeplink and uses it directly as the destination path when saving a file. There is no apparent check that the resolved path stays inside the directory the app intends to write to, so ../ segments are followed and the write lands wherever the attacker points it. The report describes the traversal as textbook and does not describe any code-level defence.
Directories such as /sdcard/Download are shared, so a file written there is readable by other applications that hold READ or MANAGE external storage permissions.
Impact
An attacker can send or add a malicious link that causes the app to write the user's private information, in the demonstrated case a progress report, into a shared directory. Any third-party app on the device with READ or MANAGE external storage permissions can then read that file. The report describes the exposed data as the user's private info (any).
The attack requires the victim to open the crafted link, and the exfiltration step requires a third-party app on the device that can read shared storage.
Fix
The report does not describe a fix or a remediation that was applied.
- Other deeplink handlers in the same app that accept a filename or path parameter. A positive result is a file appearing outside the app's private directory after opening a crafted link.
- Encoded traversal: try
%2e%2e%2fand double-encoded forms infilename, in case a filter decodes after checking. A positive result is the same out-of-directory write. - Absolute paths without traversal, for example a
filenamethat starts directly with a shared directory. A positive result is a write to that directory without any../needed. - Other shared locations reachable from the app, such as other public storage directories, to see how far the write primitive extends.
- The same parameter on other platforms or clients that share the deeplink scheme, checking whether the path handling is implemented consistently.
This kind of bug hides where a mobile app accepts a URL parameter and turns it into a filesystem path: file downloads, exports, report generation and "save as" flows behind deeplinks. During recon, the signals are a manifest that registers broad deeplink patterns such as https://host/* and any documented or observed query parameter whose name suggests a filename or path. On a device, watching where files land after opening a crafted link is enough to confirm the primitive.
The impact case here rests on two things the researcher made explicit: the file is written to a shared directory rather than app-private storage, and any third-party app with READ or MANAGE external storage permissions can pick it up. Demonstrating both, plus the fact that the link can be planted in ordinary Basecamp content such as comments, is what turns a path traversal into a credible disclosure of private user data.
What happened, in plain words
Basecamp makes an Android app, the kind you install from the Play Store on a phone. That app can be told to open links that start with https://3.basecamp.com/. Normally this is a convenience: you tap a link to a Basecamp project or report and it opens inside the app instead of in your browser. This is called a deeplink, and you can think of it as a private door into the app that only certain addresses can use.
One of the things the app can do when it opens such a link is save a file to the phone. The link can carry an extra instruction, a parameter called filename, that says where on the phone the file should be written. A parameter is just a named value attached to a link, the part after a ?, like the size you pick when ordering a coffee.
The problem is that the app takes that filename value and uses it as a real file path on the phone without checking it. By putting a series of ../ pieces into the value, an attacker can make the app walk out of the folder it meant to use and write the file somewhere shared instead. ../ means "go up one folder", the same way cd .. works in a terminal. This trick is called path traversal, and it is one of the oldest bugs in the book.
Once the file sits in a shared folder such as the phone's Download directory, any other app on the phone that is allowed to read shared storage can pick it up. So a link that looks harmless can quietly copy a user's private Basecamp information into a place other apps can read. The victim only has to tap the link once.
The app that was tested
The researcher tested a specific build of the Android app. The details below identify exactly which version, so that anyone repeating the test knows what they are looking at:
[------------------------------------Package Details---------------------------------------]:
| Application Name :Basecamp
| Package Name :com.basecamp.bc3
| Version code :380
| Version Name :4.8.6
| Mimimum SDK :28
| Target SDK :34
| Max SDK :None
| Sha256 :[redacted]
[------------------------------------------------------------------------------------------]
Line by line:
Application Name :Basecampis the name you see on the phone's home screen.Package Name :com.basecamp.bc3is the app's unique identifier on Android. Every app has one, a bit like a postal address, and it is how the system tells apps apart even if two share a display name.Version code :380is an internal number Android uses to decide which build is newer.Version Name :4.8.6is the human-friendly version number shown in the store.Mimimum SDK :28is the oldest Android version (API level) the app will install on. API level 28 corresponds to Android 9.Target SDK :34is the Android version the app was built and tested against, API level 34, which is Android 14.Max SDK :Nonemeans there is no upper limit declared.Sha256 :124861...is a fingerprint of the exact file that was tested. If you download the app and compute the same fingerprint, you know you have the identical build. It is like a wax seal on an envelope.
How the bug was found
The starting point is the app's manifest. On Android, every app ships a manifest file that declares what the app can do, including which kinds of links it wants to handle. This app declares that it handles deeplinks of the form https://3.basecamp.com/*. The * is a wildcard meaning "anything after this".
The interesting part is that one particular deeplink accepts an extra parameter called filename, and the app uses that value to decide where to save a file on the phone. Whenever a value that comes from outside, such as a URL, is used as a file path, that is the classic shape of a path traversal bug. So the researcher tested whether ../ sequences inside that value are followed. They were.
Exploiting it
Step 1: build the malicious link
The link below points at a progress report and supplies a filename value made of many ../ segments followed by a target path on shared storage:
<a href="https://3.basecamp.com/5195267/reports/progress?filename=/../../../../../../../../../../sdcard/Download/disclosure.txt">click me</a>
What each part does:
<a href="...">click me</a>is ordinary HTML for a clickable link. The textclick meis what the victim sees; the address insidehrefis where the tap sends them.https://3.basecamp.com/5195267/reports/progressis the legitimate deeplink the app already knows how to handle.?filename=starts the query string, the part of a URL that carries extra named values. Here the name isfilenameand everything after the=is its value./../../../../../../../../../../sdcard/Download/disclosure.txtis the injected value. The leading/plus the repeated../climb out of whatever folder the app would normally write to, one level per../. The remainder,sdcard/Download/disclosure.txt, names the shared Download folder and the file to create there.
When the link is opened, the app saves the user's progress report to /sdcard/Download/disclosure.txt.
Step 2: deliver the link
Basecamp lets people put links inside comments, projects and similar content. That means the malicious link can be placed almost anywhere a link is accepted, so the attacker does not need to trick the victim into typing an address by hand. The recording shows the link being used in that context:
The video, Screen_Recording_2024-06-16_at_08.58.13.mov, accompanies the step where the link is placed in Basecamp content.
Why it works
The app takes the filename value from a link that anyone can send and uses it directly as the destination path when saving a file. Nothing appears to check that the final path stays inside the folder the app intends to write to. So the ../ segments are followed and the write lands wherever the attacker points it. The report describes the traversal as textbook and does not describe any code-level defence.
The impact also depends on how Android handles storage. Folders such as /sdcard/Download are shared, so a file written there can be read by other apps that hold READ or MANAGE external storage permissions. Those permissions are the phone-level rights an app asks for to look at files outside its own private area.
What an attacker gains
An attacker can send or add a malicious link that makes the app write the user's private information, in the demonstrated case a progress report, into a shared folder. Any third-party app on the phone with READ or MANAGE external storage permissions can then read that file. The report describes the exposed data as the user's private info (any).
The attack requires the victim to open the crafted link, and the theft step requires a third-party app on the phone that can read shared storage.
Fix
The report does not describe a fix or a remediation that was applied.
- Other deeplink handlers in the same app that accept a filename or path parameter. A positive result is a file appearing outside the app's private folder after opening a crafted link.
- Encoded traversal: try
%2e%2e%2fand double-encoded forms infilename, in case a filter decodes after checking.%2eis the URL encoding of a dot and%2fof a slash, so this is the same../written in disguise. A positive result is the same out-of-folder write. - Absolute paths without traversal, for example a
filenamethat starts directly with a shared folder. A positive result is a write to that folder without any../needed. - Other shared locations reachable from the app, such as other public storage folders, to see how far the write primitive extends.
- The same parameter on other platforms or clients that share the deeplink scheme, checking whether the path handling is implemented consistently.
This kind of bug hides where a mobile app accepts a URL parameter and turns it into a file path: file downloads, exports, report generation and "save as" flows behind deeplinks. During recon, the signals are a manifest that registers broad deeplink patterns such as https://host/* and any documented or observed query parameter whose name suggests a filename or path. On a phone, watching where files land after opening a crafted link is enough to confirm the primitive.
The impact case here rests on two things the researcher made explicit: the file is written to a shared folder rather than app-private storage, and any third-party app with READ or MANAGE external storage permissions can pick it up. Demonstrating both, plus the fact that the link can be planted in ordinary Basecamp content such as comments, is what turns a path traversal into a credible disclosure of private user data.
Glossary
- Android manifest: a file inside every Android app that declares what the app can do, including which links it handles and which permissions it asks for.
- API level (SDK): a number that identifies an Android version's capabilities; higher means newer.
- Deeplink: a link that opens a specific screen inside an app rather than a page in a browser.
- External storage: the shared part of a phone's storage, such as the Download folder, that more than one app can access.
- HTML: the language web pages are written in;
<a href="...">creates a clickable link. - Manifest: see Android manifest.
- Package name: the unique identifier of an app on Android, for example
com.basecamp.bc3. - Parameter: a named value attached to a link after a
?, used to pass extra instructions. - Path traversal: a bug where an attacker uses
../sequences to make a program read or write outside the folder it intended. - Permission (READ / MANAGE external storage): a right an app asks the phone for, here the right to read or manage files in shared storage.
- Query string: the part of a URL after the
?that carries parameters. - Recon: the information-gathering phase of security testing, before trying an attack.
- Sha256: a fingerprint computed from a file's contents, used to confirm you have exactly the same file.
- Third-party app: any app on the phone other than the one being discussed.
- URL encoding: writing special characters as
%codes, for example%2efor a dot and%2ffor a slash. - Wildcard (
*): a symbol meaning "anything here", used in link patterns such ashttps://3.basecamp.com/*. - Write primitive: a basic ability an attacker has gained, here the ability to make the app write a file to a chosen location.