Skip to content
Crypto Disclosed report Intermediate

█████████ - Insecure download cookie generation allows bypass of CAC authentication, access to deleted and locked files

The download cookie was generated client-side using only the file ID and its password, without a server-side secret. An attacker who knows these values could craft a cookie to bypass CAC authentication and download deleted or locked files.

cablej_dds Follow

Originally disclosed on HackerOne

Critical View original
  • Triaged in 11 hours
  • Fixed in 3 months
  • Disclosed after 15 months

Summary:

To download a file, ████ directs users to /██████████/Download.aspx and sets a cookie authenticating the download. The cookie looks like this:

pickup=Subject=&PackageID=MTU4NDgzMTU=███

If an attacker can generate this cookie, this allows downloading a file. As it turns out, the generation of the cookie is fairly straightforward and requires no server-side key, only a file ID and its associated password. The components are:

  1. The file ID, base 64 encoded, followed by a dash
  2. The SHA512 hash of the plaintext file ID, base 64 encoded
  3. The secret key of the package (as sent in the email), base 64 encoded, followed by a dash
  4. The SHA2512 hash of the secret key, base 64 encoded

By generating a cookie using this format, an attacker can accomplish the following:

  1. Bypass CAC-enforced files.
  2. Bypass deleted files (tested when a user deletes their package). Untested if this allows accessing historical files.
  3. Bypass "locked" files that have already been downloaded.

For instance, after attempting to download a deleted package on █████, █████ displays the following error:

The package Is no longer available For download. The file(s) has been permanently deleted from ███████. You will have To contact the sender And ask them To upload the file(s) again.

However, this is not true. By making a crafted request to /█████████/Download.aspx given the above cookies, a user can still download deleted files. This may also apply to past files, meaning that all previous uploaded files may not be deleted. I will test this when files I have submitted expire.

Impact

Significant bypasses to █████████ security controls, including:

  • Bypass CAC protections
  • Download files that ███ says have been deleted from the file system
  • Download locked files that have already been downloaded

It is unclear at the moment if this also applies to files that have expired after a set period of time. I will retest when files I have uploaded have expired.

Step-by-step Reproduction Instructions

  1. Visit https://███████/██████/pickupfiles.aspx?id=15849581, a file I uploaded and deleted.
  2. Try the password █████████. Observe that an error is displayed that the file is deleted.
  3. As described above, generate the following cookie, based on the file ID and password.
pickup=Subject=&PackageID=MTU4NDk1ODE=█████████
  1. Make the following GET request with the cookie:
GET /████████/Download.aspx?PackageID=15849581&FileName=dog.jpg HTTP/1.1
Host: ███████
Connection: close
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Referer: https://█████/██████████/pickupfiles.aspx?id=15849581
Accept-Language: en-US,en;q=0.9
Cookie:  pickup=Subject=&PackageID=MTU4NDk1ODE=████

  1. Observe that the file is returned, demonstrating that it has not been deleted.

This also has been tested with CAC-enforced files and files that are "locked" due to already having been downloaded.

Impact

.

The original report as published on HackerOne, by cablej_dds. 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 authorisation cookie is generated client-side from predictable values (file ID and password) without a server-side secret, so it can be forged.

Impact

An attacker could bypass CAC protections and download files that the system claims are deleted or locked, though it is unclear if expired files are also affected.

What the attacker needed

Knowledge of file ID and password; ability to send crafted HTTP requests

How it was found

  1. Visit the pickup files page for a file that was uploaded and then deleted.
  2. Try the password and see the error that the file is deleted.
  3. Generate a download cookie using the file ID and password.
  4. Send a GET request to the download endpoint with the crafted cookie.
  5. Observe that the file is returned, showing it was not actually deleted.

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.

When you download a file from this service, your browser gets a special cookie that proves you are allowed to download it. The problem is that this cookie is made using only the file's ID and its password, which the attacker already knows, so they can make their own cookie. That lets them download files that should be protected, deleted, or locked.

What is Crypto?

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.

More by cablej_dds

View all

8 more disclosed reports, best first.

More from U.S. Dept Of Defense

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cryptographic weaknesses

The lesson behind this report.

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.