You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your api reacts to client-side set host headers by redirecting somewhere internally and then returning html code. A potential security risk, I think, because it seems like undefined behavior.
Use-Case:
While developing an app that uses your api, I had to setup an api request proxy through a traefik router that proxies from our client to your api. The vanilla setup looks like this:
The deepl api should not care about a host header when it receives it from a client and properly perform the requested translation.
Actual behaviour:
Because traefik stores the original host in the respective header field, the deepl API returns a 503 with the following html:
<!DOCTYPE html><htmllang="en"><head><metacharset="utf-8"/><title>Page Load Error</title><style>
.button{background-color:#0f2b46;border:none;color:#fff;padding:15px;text-align:center;text-decoration:none;display:inline-block;font-size:16px;margin:4px2px;cursor:pointer;border-radius:8px;max-width:100px}div.content{margin:center;width:500px}button,h1,object,p{text-align:center;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif!important}.centering{display:flex;justify-content:center;align-items: center;flex-direction: column}#robot{max-width:200px}#reload-button{padding:2em}
</style><linkrel="icon" type="image/png" href="https://static.deepl.com/img/favicon/favicon_16.png" sizes="16x16" /><linkrel="icon" type="image/png" href="https://static.deepl.com/img/favicon/favicon_32.png" sizes="32x32" /><linkrel="icon" type="image/png" href="https://static.deepl.com/img/favicon/favicon_96.png" sizes="96x96" /></head><body><main><divclass=centering><imgwidth="100px" src="https://static.deepl.com/img/logo/DeepL_Logo_darkBlue_v2.svg" /><h1>We're sorry!</h1><divclass=centering><imgid="robot" src="https://static.deepl.com/img/404/robot.svg"/></div><p>Something went wrong. We're working on it 👷</p><p>Try reloading this page or come back later.</p><divclass=centeringid=reload-button><buttononClick="location.reload();" class="button">Reload</button></div></main></body></html>
Suggested Fix (server-side/deepl-api-side):
Don't use the client-side transmitted HOST header to do something internally in your API. I would rate that as a potential security risk. Store the client headers when you receive the request the first time and set your own headers properly. Otherwise one of your servers apparently gets confused.
Suggested Fix (client side):
For anyone stumbling across the same problem, just tell traefik to not pass the host header with a simple config change:
services:
deepl:
loadBalancer:
passHostHeader: false # <-- this little bitch... incredibly important because DeepL API runs into undefined behavior if a host header is passed to it.servers:
- url: "https://api.deepl.com/v2/translate"
The text was updated successfully, but these errors were encountered:
Hi, thanks for your report, but I will close here.
The deepl api should not care about a host header when it receives it from a client and properly perform the requested translation.
We cannot ignore the Host header. See for example here or here:
The "Host: hostname" header value distinguishes between various DNS names sharing a single IP address, allowing name-based virtual hosting. While optional in HTTP/1.0, it is mandatory in HTTP/1.1.
You can check other Websites/APIs (e.g. Google), they will not ignore the Host field either.
The error you observe is intentional and not "redirecting from somewhere internally" and hence not a security risk. As we take security seriously, I specifically checked this with the responsible team.
Summary:
Your api reacts to client-side set host headers by redirecting somewhere internally and then returning html code. A potential security risk, I think, because it seems like undefined behavior.
Use-Case:
While developing an app that uses your api, I had to setup an api request proxy through a traefik router that proxies from our client to your api. The vanilla setup looks like this:
You can start this config locally with:
And request using cURL like this:
Expected Behaviour:
The deepl api should not care about a host header when it receives it from a client and properly perform the requested translation.
Actual behaviour:
Because traefik stores the original host in the respective header field, the deepl API returns a 503 with the following html:
Suggested Fix (server-side/deepl-api-side):
Don't use the client-side transmitted HOST header to do something internally in your API. I would rate that as a potential security risk. Store the client headers when you receive the request the first time and set your own headers properly. Otherwise one of your servers apparently gets confused.
Suggested Fix (client side):
For anyone stumbling across the same problem, just tell traefik to not pass the host header with a simple config change:
The text was updated successfully, but these errors were encountered: