question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Secure and unsafe URLs do not work as expected

See original GitHub issue
  1. Secure URLs in version 3 are not secure.

  2. It is impossible to disable unsafe URLs using the ENV vars (in v2 or v3)

  • Below are examples from my deployments for each version to demonstrate the problem.
  • All urls were requested for the first time for these tests, so CloudFront cache was empty for each one.
  • Screenshots of the Lambda config for the v2 and v3 deployments are shown below.

v2

  1. With hash: loads (good):

    https://d3f24ahusl0vhu.cloudfront.net/UpwsFH4gS8sPRTzw6Adc0sHKGwQ=/onfLoZx7d
    
  2. With no hash or unsafe: error (good)

    https://d3f24ahusl0vhu.cloudfront.net/onfLoZx7d
    
  3. With unsafe: loads (bad)

    https://d3f24ahusl0vhu.cloudfront.net/unsafe/onfLoZx7d
    

v3

  1. With hash: error (bad)

    https://d18aelkez1p3a0.cloudfront.net/5jel0cJtBXmMLI1Rupih8M6eiPc=/8GKv8lk32m
    
  2. With no hash or unsafe: error (good)

    https://d18aelkez1p3a0.cloudfront.net/8GKv8lk32m
    
  3. With unsafe: loads (bad)

    https://d18aelkez1p3a0.cloudfront.net/unsafe/8GKv8lk32m
    
  4. With secret key in URL: loads (bad)

    https://d18aelkez1p3a0.cloudfront.net/<redacted>/8GKv8lk32m
    

v2

image

v3

image

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
razor-xcommented, Oct 10, 2018

@timkelty I agree. If you wanted URLs with out unsafe or the HMAC I would expect having to handle it via rewrite rules.

For anyone coming to this thread, I’ve summarized what I understand the expected behaviour should be below. Given the above examples however we know actual behaviour does not currently match (gsingh04 identified there may be a bug in Thumbor to account for some, but not all, of the issues).

  1. With ALLOW_UNSAFE_URL=Yes a. Not load: https://example.cloudfront.net/<imagePath>/500x500.png b. Load: https://example.cloudfront.net/unsafe/<imagePath>/500x500.png c. Not load: https://example.cloudfront.net/<any-other-value>/<imagePath>/500x500.png
  2. With ALLOW_UNSAFE_URL=Yes and SECURITY_KEY="top-secret" a. Not load: https://example.cloudfront.net/<imagePath>/500x500.png b. Load: https://example.cloudfront.net/unsafe/<imagePath>/500x500.png c. Not load: https://example.cloudfront.net/top-secret/<imagePath>/500x500.png d. Load: https://example.cloudfront.net/<correct-hmac>/<imagePath>/500x500.png e. Not load: https://example.cloudfront.net/<any-other-value>/<imagePath>/500x500.png
  3. With ALLOW_UNSAFE_URL=No and SECURITY_KEY="top-secret" a. Not load: https://example.cloudfront.net/<imagePath>/500x500.png b. Not Load: https://example.cloudfront.net/unsafe/<imagePath>/500x500.png c. Not load: https://example.cloudfront.net/top-secret/<imagePath>/500x500.png d. Load: https://example.cloudfront.net/<correct-hmac>/<imagePath>/500x500.png e. Not load: https://example.cloudfront.net/<any-other-value>/<imagePath>/500x500.png
0reactions
tschafftercommented, Dec 2, 2018

@gsingh04

please note you should provide ONLY one of the environment variables

either ALLOW_UNSAFE_URL=true: when you want to allow unsafe URLs or SECURITY_KEY=mysecuritykey: when you want to implement safe URLs resolving the issue

Why both variable can not be passed as environment variables? If ALLOW_UNSAFE_URL is set to True, isn’t SECURITY_KEY simply ignored by Thumbor?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Seeing a “Not Secure” Warning in Chrome? Here's Why and ...
The reason you are seeing the “Not Secure” warning is because the web page or website you are visiting is not providing an...
Read more >
Manage warnings about unsafe sites - Google Chrome Help
You'll see a warning if the content you're trying to see is dangerous or deceptive. These sites are often called "phishing" or "malware"...
Read more >
URL rewrite not working for us - adding unsafe to the url? #54
In my setup I managed to get safe urls working while unsafe urls would not work (as expected since they should have been...
Read more >
How To Fix the “HTTPS Not Secure” Message in Chrome
1. Purchase an SSL Certificate. To fix the 'not secure' message on your website, the first thing you need to do is purchase...
Read more >
Safe Links in Microsoft Defender for Office 365
Safe Links does not work on mail-enabled public folders. Safe Links supports only HTTP(S) and FTP formats. Using another service to wrap links ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found