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.

Crash when integrating an iframe with basic auth security

See original GitHub issue

**Home Assistant Android version: 3.0.2-full **

Android version: 10

**Phone model: samsung galaxy s10 **

**Home Assistant version: 0.118.4 **

**Last working Home Assistant release (if known): **

Description of problem: I configured in my homeassistant, a netdata iframe with this configuration :

panel_iframe:
  netdata_mypc:
    title: 'NetData MyPC'
    icon: mdi:wrench
    url: https://[mydns]:443/netdata_mypc/

As I found that the access to https://mydns:443/netdata_mypc/ was totaly open (unsecured) to every body, I put a minimal security to it by adding a basic authentification in the home assistant nginx configuration (file /share/nginx_proxy_default.conf) :

location ~ /netdata_mypc/(?<ndpath>.*) {                                                                                                                                             
        auth_basic "It's private here";                                                                                                                                                      
        auth_basic_user_file /share/.htpasswd;                                                                                                                                         
                                                                                                                                                                                       
        proxy_redirect off;                                                                                                                                                            
        proxy_set_header Host $host;                                                                                                                                                   
                                                                                                                                                                                       
        proxy_set_header X-Forwarded-Host $host;                                                                                                                                       
        proxy_set_header X-Forwarded-Server $host;                                                                                                                                     
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;                                                                                                                   
        proxy_http_version 1.1;                                                                                                                                                        
        proxy_pass_request_headers on;                                                                                                                                                 
        proxy_set_header Connection "keep-alive";                                                                                                                                      
        proxy_store off;                                                                                                                                                               
        proxy_pass http://[my_internal_ip]:19999/$ndpath$is_args$args;                                                                                                                      
                                                                                                                                                                                       
        gzip on;                                                                                                                                                                       
        gzip_proxied any;                                                                                                                                                              
        gzip_types *;                                                                                                                                                                  
}

Eveything works juste fine in my desktop browser : It get a basic authentification question when I click on the “Netdata MyPC” link in the menu from homeassistant.

When I do the same in the android app, it sometimes asks for a basic auth and then crashes or simply crashes whenever I click on the “Netdata MyPC” link.

Could you please, reproduce the problem and correct it in a future version : all my configuration is given here and I get the same problem with whatever page I integrate as an iframe (it is not specific to netdata web page).

Another point, if there exists a better authentication mechanism than basic auth to be configured in nginx and behave as a SSO with home assistant’s core one, I would configure it but I did not find anything like this.

Traceback (if applicable): I do not know how to get a traceback of the crash.


Screenshot of problem: None

Additional information: None.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:20 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
cnicocommented, Jan 8, 2021

Hi,

@dshokouhi, I’ve got a good news : the debug APK of the previous comment is working correctly. It solves completely the problem for me : I have a basic auth form and then I can access my internal web site.

Thanks for the correction and I hope it will be published in the store soon.

0reactions
cangurellobellocommented, Jan 8, 2021

@cnico can you please try the debug APK from: https://github.com/home-assistant/android/actions/runs/470040912

Yep, works for me too now. No more crashes after reloading 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

4 IFrame Security Concerns You Should Know - Bits and Pieces
However, we can't stop using iframe due to security threats. We need to be aware of them and take preventive actions to secure...
Read more >
Getting issue during Login in <iframe> using Hybrid Auth
I have successfully integrated the Hybrid Social Auth api (https://github.com/hybridauth/hybridauth). Problem is that when some one want to ...
Read more >
Long IFrame "src" attributes cause crash - Bugzilla@Mozilla
When creating an iframe with a long "src" attribute, a browser-wide crash can be invoked. A PoC is attached. It's pretty straightforward.
Read more >
Apps requiring authentication in iframe - pre-auth...
Hi, We are trying to build an app for internal org use and the app is set to require authentication and tied to...
Read more >
The iframe cross-domain policy problem - Cakemail
You could write a nice bit of code and get it working on firefox but it would crash on IE. You would think...
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