Information Disclosure through .DS_Store in ██████████
A publicly accessible .DS_Store file on a web server exposed the names of files and folders in its directory, including packages containing licence keys, Wi-Fi certificates, a root certificate, and installation scripts. An attacker could use this information to obtain sensitive material or plan further attacks.
- Triaged in 3 hours
- Fixed in 4 months
- Paid in 2 days
- Disclosed after 6 months
Hello!
Description: The website located at █████████ suffers from an information disclosure through ".DS_Store" file, accessible to unauthorised external users. In the Apple OS X operating system, .DS_Store is a file that stores custom attributes of its containing folder.
Reproduction Steps: Guide for installing DS_Store parser - https://digi.ninja/projects/fdb.php
First link: (See pic 0 and 1) ███████.DS_Store
Second link: (See pic 2 and 3) ████Packages/.DS_Store This directory contain tons of packages for MacOS Including licence keys (See pic 4 and 5) ██████████Packages/█████████ ██████████Packages/████ and etc Certificate for WIFI (See pic 6) █████████Packages/█████ Twitter Root certificate (See pic 8) █████████Packages/███████ And other juicy stuff which is intended only for Twitter employees
Third link (See pic 7) ██████████Scripts/.DS_Store This directory contain tons of scripts for installation and configuring corporate computers.
In one case the attacker can just use Twitter licenses and etc (for obvious reasons, I didn't check whether this licences is still active ), in other this information can be useful for future attacks.
Please let me know if you need some extra information. Thanks in advance!
Context
The target is a website operated by X / xAI (the report refers to Twitter throughout, including Twitter employees and a Twitter root certificate). The weakness is information disclosure: a .DS_Store file was reachable by unauthorised external users.
As the report explains, on Apple OS X a .DS_Store file stores custom attributes of its containing folder. When such a file is published alongside a directory on a web server, it can reveal the names of files and folders in that directory.
Setup
No account, role or special precondition is described. The only tooling mentioned is a parser for .DS_Store files, with the report pointing to an installation guide:
https://digi.ninja/projects/fdb.php
Finding it
The researcher found that the website at the redacted hostname served .DS_Store files that were accessible to unauthorised external users. Parsing those files revealed the names of items in the directories they belonged to.
Exploitation
Step 1: the first .DS_Store
The first link is the .DS_Store file at the site root:
███████.DS_Store
The report references pictures 0 and 1 alongside this link. The report does not describe those pictures further.
Step 2: the packages directory
The second link is a .DS_Store inside a packages directory:
████Packages/.DS_Store
According to the report, this directory contains a large number of packages for MacOS. The parsed listing exposed, among other things, licence keys:
██████████Packages/█████████
██████████Packages/████
The report references pictures 2 and 3 for this link and pictures 4 and 5 for the licence keys. It also lists a certificate for WIFI:
█████████Packages/█████
and a Twitter root certificate:
█████████Packages/███████
The WIFI certificate is referenced with picture 6 and the Twitter root certificate with picture 8. The researcher describes this material as "other juicy stuff which is intended only for Twitter employees".
Step 3: the scripts directory
The third link is a .DS_Store inside a scripts directory:
██████████Scripts/.DS_Store
This directory, per the report, contains a large number of scripts for installing and configuring corporate computers. Picture 7 is referenced for this link.
What the researcher did with the findings
The researcher notes that in one case an attacker could simply use the Twitter licences, while adding that for obvious reasons they did not check whether those licences are still active. In the other case, the information could be useful for future attacks.
Root cause
A .DS_Store file was left in web-served directories, and the server returned it to anyone who requested it. The file records the custom attributes of its containing folder, so its contents enumerate names that the directory itself does not otherwise reveal. The report does not describe any server configuration or access control that was meant to prevent this.
Impact
An unauthenticated external user could read the contents of the three .DS_Store files and learn the names of files and folders in the corresponding directories. In the packages directory this included MacOS packages, licence keys, a WIFI certificate and a Twitter root certificate; in the scripts directory it included installation and configuration scripts for corporate computers. The researcher frames the impact in two ways: direct use of the Twitter licences (with the caveat that they did not verify whether the licences are still active), and use of the disclosed information for future attacks.
Fix
The measure implied by the finding is to stop serving .DS_Store files from web-accessible directories, for example by removing them from deployed content or by denying requests for them at the server.
Variants to test
- Request
.DS_Storeat the web root and in each subdirectory that serves static content. A positive result is a binary file that a parser turns into a list of names not visible in the directory listing. - Check sibling metadata files from other platforms and editors in the same directories. A positive result is any file that enumerates names or paths the site does not otherwise expose.
- Follow names recovered from one
.DS_Storeinto the directories they point to, and request.DS_Storethere as well. A positive result is a chain of directories whose contents become enumerable step by step.
Hunting notes
This kind of bug hides in directories that are published as static content, especially download or package directories and script or tooling directories that were copied to the server from a Mac. During recon, the signal is a directory that returns files but not a listing, combined with the presence of Apple-specific artefacts. The researcher demonstrated impact by parsing each .DS_Store and listing the sensitive material the directories contained: licence keys, a WIFI certificate, a Twitter root certificate and corporate installation scripts. The report was disclosed on 12 December 2016 with a bounty of 560.00 USD.
What happened, in plain words
A security researcher found that a website run by X / xAI (the report talks about Twitter throughout, including Twitter employees and a Twitter root certificate) was handing out a small hidden file that it should never have made public. That file is called .DS_Store, and it is created automatically by Apple computers. It is not meant to be seen by visitors, but if it ends up on a web server that serves it, anyone on the internet can download it.
On its own, .DS_Store looks like meaningless binary noise. The trick is that it stores custom attributes of its containing folder, and parsing it can reveal the names of the files and folders in that directory. So by downloading it and running it through a small tool, the researcher could read the names of things in directories that the website did not otherwise show. In this case the directories involved contained MacOS software packages, licence keys, a WIFI certificate, a Twitter root certificate and scripts used to set up corporate computers.
This kind of problem is called information disclosure: nothing is broken into and no password is guessed, but information that was supposed to stay private leaks out. A useful everyday comparison is a filing cabinet with opaque drawers. You cannot see inside, but someone left the handwritten inventory list on top of the cabinet, and the list names every folder inside.
The concepts you need first
Before walking through the steps, here are the ideas the report relies on, explained from zero.
- Web server and web root. A web server is the program that answers when your browser asks for a page or a file. The web root is the top folder it serves from. Anything placed inside that folder can, in principle, be requested by anyone with a browser.
- URL and path. A URL is the address you type, such as
https://example.com/folder/file.txt. The part after the domain, here/folder/file.txt, is the path, and it maps onto folders and files on the server. - Directory listing. Some servers, when asked for a folder rather than a file, reply with an automatic list of everything inside, like opening a drawer and seeing the contents. Many servers turn this off, so the folder appears empty to a visitor even though it is full. That is exactly the situation where a stray
.DS_Storematters: the folder looks empty, but the hidden file still names what is in it. .DS_Store. On Apple OS X (now called macOS), whenever you open a folder in Finder, the system writes a hidden file called.DS_Storeinto that folder. It stores custom attributes of its containing folder, meaning things like where icons sit, the window size, and the names of the items in the folder. The leading dot makes it hidden in Finder, which is why most people never notice it.- Parser. A parser is a program that reads a file format and turns it into something a human can read.
.DS_Storeis binary, so you need a parser to make sense of it. - Certificate. A certificate is a digital document that proves an identity, a bit like a passport for a machine or a service. A root certificate is the top-level one that a whole chain of trust is built on. A WIFI certificate here is a certificate used for connecting to a wireless network.
- Licence key. A licence key is a string of characters that proves you paid for a piece of software. If it leaks, someone else may be able to use the software on your licence.
- Unauthenticated. This simply means "without logging in". The researcher did not need an account, a password or any special role. Anyone with a browser could do the same thing.
- Redaction. In the published report, hostnames and file paths are replaced with blocks like
███████. That is done to avoid pointing the public at live systems. The blocks are not part of the real address.
Setup
No account, role or special precondition is described. The only tooling mentioned is a parser for .DS_Store files, and the report points to an installation guide for it:
https://digi.ninja/projects/fdb.php
This is a single line: a web address. It is not a request against the target; it is where you go to read how to install the parser. The reason for needing a parser is the one above: the raw file is binary, so opening it in a browser shows garbage. The parser reads that garbage and prints the names of the files and folders recorded inside it.
Finding it
The researcher found that the website at the redacted hostname served .DS_Store files that were accessible to unauthorised external users. In plain terms: the files had been copied to the server along with the folders they belonged to, and the server returned them to anyone who asked, with no login required. Parsing those files then revealed the names of items in the directories they belonged to.
Exploitation
Step 1: the first .DS_Store
The first link is the .DS_Store file at the site root:
███████.DS_Store
This is one path, ending in .DS_Store. The redacted part is the hostname or folder in front of it.
The report references pictures 0 and 1 alongside this link. The report does not describe those pictures further.
Step 2: the packages directory
The second link is a .DS_Store inside a packages directory:
████Packages/.DS_Store
Again this is a single path. The difference from step 1 is the Packages/ folder in the middle: this is a .DS_Store inside a subfolder. Each folder on a Mac gets its own .DS_Store, so each one is a separate list of names.
According to the report, this directory contains a large number of packages for MacOS. A package here means an installer file for software. The parsed listing exposed, among other things, licence keys:
██████████Packages/█████████
██████████Packages/████
These are two paths, one per line, both inside the Packages folder. They are the names that the parsed .DS_Store revealed.
The report references pictures 2 and 3 for this link and pictures 4 and 5 for the licence keys. It also lists a certificate for WIFI:
█████████Packages/█████
and a Twitter root certificate:
█████████Packages/███████
Each of these is a single path inside the packages folder. The WIFI certificate is referenced with picture 6 and the Twitter root certificate with picture 8. The researcher describes this material as "other juicy stuff which is intended only for Twitter employees".
Step 3: the scripts directory
The third link is a .DS_Store inside a scripts directory:
██████████Scripts/.DS_Store
Same pattern once more: one path, this time in a folder called Scripts. This directory, per the report, contains a large number of scripts for installing and configuring corporate computers. A script is a small program that automates a task, so these are the files an IT team would run to set up an employee's machine. Picture 7 is referenced for this link.
What the researcher did with the findings
The researcher notes that in one case an attacker could simply use the Twitter licences, while adding that for obvious reasons they did not check whether those licences are still active. In the other case, the information could be useful for future attacks. In other words, the value is twofold: some items might be usable straight away, and the rest gives an attacker a map of the internal setup to plan against later.
Root cause
A .DS_Store file was left in web-served directories, and the server returned it to anyone who requested it. The file records the custom attributes of its containing folder, so its contents enumerate names that the directory itself does not otherwise reveal. The report does not describe any server configuration or access control that was meant to prevent this.
The everyday version: someone copied a folder from a Mac to a web server, and the hidden inventory file travelled with it. The server was configured to hand out any file it was asked for, so the inventory went out too.
Impact
An unauthenticated external user could read the contents of the three .DS_Store files and learn the names of files and folders in the corresponding directories. In the packages directory this included MacOS packages, licence keys, a WIFI certificate and a Twitter root certificate; in the scripts directory it included installation and configuration scripts for corporate computers.
The researcher frames the impact in two ways: direct use of the Twitter licences (with the caveat that they did not verify whether the licences are still active), and use of the disclosed information for future attacks. That distinction matters: knowing a file's name is not the same as having downloaded the file.
Fix
The measure implied by the finding is to stop serving .DS_Store files from web-accessible directories, for example by removing them from deployed content or by denying requests for them at the server.
Variants to test
If you want to look for the same class of problem yourself, these are the patterns worth trying. Each one is a small experiment with a clear pass or fail.
- Request
.DS_Storeat the web root and in each subdirectory that serves static content. A positive result is a binary file that a parser turns into a list of names not visible in the directory listing. - Check sibling metadata files from other platforms and editors in the same directories. A positive result is any file that enumerates names or paths the site does not otherwise expose.
- Follow names recovered from one
.DS_Storeinto the directories they point to, and request.DS_Storethere as well. A positive result is a chain of directories whose contents become enumerable step by step.
Hunting notes
This kind of bug hides in directories that are published as static content, especially download or package directories and script or tooling directories that were copied to the server from a Mac. Static content means files that are simply stored and handed out as they are, rather than generated by an application. During recon, the signal is a directory that returns files but not a listing, combined with the presence of Apple-specific artefacts.
The researcher demonstrated impact by parsing each .DS_Store and listing the sensitive material the directories contained: licence keys, a WIFI certificate, a Twitter root certificate and corporate installation scripts. The report was disclosed on 12 December 2016 with a bounty of 560.00 USD.
Glossary
.DS_Store: a hidden file that Apple OS X writes into a folder to store custom attributes of its containing folder, including the names of the items in it.- Bounty: a payment made by an organisation to a researcher who reports a valid security problem.
- Certificate: a digital document that proves the identity of a machine or service, like a passport.
- Custom attributes: extra settings a system stores about a folder, such as icon positions and window size.
- Directory: another word for a folder.
- Directory listing: an automatic list of a folder's contents that some web servers return when the folder is requested.
- Disclosure (of a report): making a bug report public, usually after it has been fixed.
- Information disclosure: a weakness where information meant to stay private is exposed to people who should not see it.
- Licence key: a string of characters that proves software was paid for and may be used.
- Package: an installer file for software.
- Parser: a program that reads a file format and turns it into something a human can read.
- Path: the part of a URL after the domain that maps onto folders and files on the server.
- Recon: short for reconnaissance, the early stage of looking at a target to see what it exposes.
- Redaction: replacing sensitive text, such as hostnames, with blocks like
███████before publishing. - Root certificate: the top-level certificate that a chain of trust is built on.
- Script: a small program that automates a task.
- Static content: files stored on a server and handed out as they are, rather than generated on the fly.
- Unauthenticated: without logging in, with no account or special role.
- URL: the address of a page or file on the web.
- Web root: the top folder a web server serves files from.
- Web server: the program that answers browser requests and sends back pages and files.
- WIFI certificate: a certificate used when connecting to a wireless network.