gchq / CyberChef

The Cyber Swiss Army Knife - a web app for encryption, encoding, compression and data analysis
https://gchq.github.io/CyberChef
Apache License 2.0
28.48k stars 3.2k forks source link

Bug report: "HTTP request" cannot read some binary data well #1220

Open mikecat opened 3 years ago

mikecat commented 3 years ago

Describe the bug

"HTTP request" sometimes fails to load correct data and replaces some part of data with ef bf bd (�).

To Reproduce Steps to reproduce the behaviour or a link to the recipe / input used to cause the bug:

  1. Use "HTTP request" with URL https://placehold.jp/150x150.png and default configuration.
  2. It fails due to cross-origin request, so use CORS Everywhere (Firefox extension) to disable the limitation.
  3. Use "Render Image" after that, seeing it shows "Invalid file type"
  4. Use "To Hex" to see wrong data ef bf bd inserted.

Expected behaviour

"HTTP request" should successfully fetch data from external site without changing any part of that to ef bf bd and "Render Image" should successfully show the image.

I feeded the image data to "Render Image" after fetching the data via this Python script:

import urllib.request

handle = urllib.request.urlopen("https://placehold.jp/150x150.png")
data = handle.read()
handle.close()

dump = ""

for c in data:
    dump += "%02x" % c

print(dump)

to make sure that "Render Image" supports the image data. It successfully showed the image.

Desktop (if relevant, please complete the following information):

w4po commented 3 months ago

2024 and I have the same issue.