fireproofsocks
Given a particularly devious S3 object key, e.g.
"users/f8db13a0-e2b8-45cd-a902-5eede074eb46/~*\\|:\"<> +`!@#$%^&()-=_[]{};',.?š§Ŗ//fakedata~*\\|:\"<> +`!@#$%^&()-=_[]{};',.?š§Ŗ.txt"
Iām running into HTTP 505 errors from the ExAws client, e.g.
bucket
|> ExAws.S3.head_object(object_key)
|> ExAws.request()
I can see the objects there if I run ExAws.S3.list_objects/2 or ExAws.S3.list_objects_v2/2
A python script uploaded the file (probably using official boto), but Iām failing to retrieve it.
Frustratingly, the AWS docs about 5xx errors do not mention 505 errors anywhere. There are few other mentions of this error (e.g. this one).
Because Iām able to interact with other ānormally namedā objects in the same bucket, the culprit is likely the weird object key. Has anyone else encountered this? Is this perhaps a bug in ExAws.S3?
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
Iām aware of 2 such projects, are there others?
git: GitHub - team-alembic/realworld: A fullstack Phoenix LiveView application with back...
New
Hi all,
Iām working on a Phoenix project where I need to make external HTTP requests and Iām trying to choose between Req and HTTPoison....
New
Hi,
we run different LLM models across a cluster, with each node loading a configurable subset. Model-specific queues let nodes consume ...
New
Hello
Iāve been coding in Elixir for almost two years now because of my current job where we implemented Elixir in our application. But ...
New
Hi all, Iām new here and would like to hear peoples views on my Elixir/Phoenix based game-engine! :smiley:
Mutonex gamedesign was finish...
New
Hi, Iām evaluating Ash as a foundation for our future business applications.
So far I love it, and thereās just one usecase I havenāt be...
New
Other Trending Topics
Hey there,
I havenāt seen a list of useful Elixir specific skills for the popular AI tools yet so Iām starting one here with my first.
...
New
Hi everyone :waving_hand:
I wanted to share something Iāve been building ā NowBlind, a random chat app designed to help people discover ...
New
I fully migrated to my own harness from Anthropic/Gemini and I think itās time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. Iām finding it pretty diff...
New
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, Iām not sure which exactly)
AI dream has many faces, but general...
New
With AI doing more of the implementation work, Iāve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #code-sync
- #discussion
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #ai
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #blog-post
- #elixirconf-us
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #security
- #elixirconf-eu
- #api
- #forms
- #hex










Showing Posts 1 to 7- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
benwilson512
This key contains values that are to be avoided according to the AWS docs Naming Amazon S3 objects - Amazon Simple Storage Service. I donāt expect ExAws.S3 is going to do a good job handling characters that AWS S3 itself says not to use.
al2o3cr
The 505 error code is defined by RFC2616 as āHTTP Version Not Supportedā.
My guess is that this error is being triggered by the unescaped space character in that key - the request would look something like
so the part of the key after the space is being interpreted as the requested HTTP version, and the S3 server is replying with a 505 because it looks for
<method> <url> <version>.fireproofsocks
For sure, these are intentionally problematic keys, but they do represent possible values, and we canāt control what files the Python users might lob our way.
fireproofsocks
This seems plausible ā some of the other posts Iāve found describing similar errors seem to have something to do with spaces and encoding. Iām not sure how to escape the space in this case⦠adding a backslash or replacing it with
+didnāt seem to work. Thoughts?Iām definitely feeling like the better option is to just reject any file names like that in our app. Even if they were ālegitimatelyā created elsewhere (e.g. using
boto), our app canāt handle them in any practical sense.al2o3cr
IIRC the
+-as-space escape sequence only works in query strings; try%20insteadLostKobrakai
I fixed some encoding in ex_aws a few month ago around encoding spaces, which didnāt work with minio. Maybe thatās related: Use percent encoding instead of www form for header by LostKobrakai Ā· Pull Request #184 Ā· ex-aws/ex_aws_s3 Ā· GitHub
evadne
The proper fix/workaround is to store objects with GUID keys in S3 only (actual file name stored in database) and then use content-disposition to emit correct file names later.
As @LostKobrakai discussed, you can consider sanitising/encoding the characters or changing them to hex representation, however there is no standardised way to pass string literal within JSON & there may be significant work required to handle these files.
I think only place in ex_aws to change would be to do this encoding/decoding transparently (as breaking change) in
ExAws.Operation.S3.add_bucket_to_path/2or maybe ratchet up a step and use XML for outgoing requests (so you get proper string literals that can represent the object names you need), however as it would create such huge support burden for the maintainers + is already discouraged by AWS + would encourage further bad application design, I donāt think it will be considered AT ALLSo my best suggestion is to change design as previously mentioned to obviate the need of this rigmarole. It is also the right thing to do, if you could sanitise the names with some kind of URI encoded string and avoid a whole class of security bugs⦠such as user putting a file name that effectively results in a path traversal exploit. The bigger the attack surface the more bigger your risk.