-
-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: popup - iframe stop working on LWC 3.8 #4863
Comments
|
hi @Antoviscomi i'm talking about html, <iframe> tag |
@josemvm that's now sanified as well as all html tags to any dynamic container to avoid xss attacs, so all the readdresing on dynamic contents shall be unavailable. |
@Antoviscomi yes i really understand the security issues but there should also be the possibility of creating exceptions for what is truly secure, i think |
@josemvm I totally agree with you! |
@josemvm right but doesn't works without a parent layer, that is, if the layer that allows the iframe to be displayed does not have a parent or a relation setted I suppose. Furthermore the content you need to serve is a static file (.pdf) not a dynamic object, so the sanitization problem in case of dynamic content (in example html document with bookmarks) remains unsolved |
yes, but it's very strange... |
Fixed by #4953 |
The transfer of “https://xxx.yyy.zzz/index.php/view/media/getMedia?repository=ma&project=operacoesU&path=media%2Fp_rusticos%2FR-ARL-C-2.pdf” was blocked because the iframe where it was triggered has the sandbox tag defined. |
LWC 3.8.4 - be354fcbc |
@josemvm not in mine as you can see below using
and where Video.del.21-01-2025.17.13.26.webm |
@Antoviscomi what is your lizmap version? |
@josemvm You are just reopening this ticket by only copy/pasting your error, without context. From your error :
Please search at least what https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#sandbox If sandbox is present, then it's more "secure" than "not present". Like the iframe of @Antoviscomi which doesn't have the |
|
@Gustry @josemvm the behaviour it's correct with |
Yes, the |
Hum, not so sure, the lizmap-web-client/assets/src/modules/Utils.js Line 214 in 7c5b679
|
I think the only definitive solution is to implement in the jelix framework a whitelist of IPs or Domains allowed to access the iframe in LWC, orherwise we'll forever affected from this behaviours |
Yes @josemvm as you can see, in 3.7.14 javascript are allowed
that are locked in 3.8.4 |
my domain in not a public domain, it is within my local network |
same as mine |
I have not tested but if pdf files can be public you can put them in the root data folder above the repositories. You should be able to view them in iframes. |
@nboisteault true for LWC 3.7.14 but not in 3.8.4 at the moment, i had put the pdf in a root (server) folder, i serve this root independently to LWC so this appear as cross-origin to the browser… that lock my domain only in LWC 3.8.4 as I tried to explain in the above comment |
@nboisteault and only for pdfs, I'm able to open .jpg, .html, .png and all other than pdfs |
Project https://sandbox.lizmap.com/lizmap_3_8/index.php/view/map?repository=tests&project=xss
I'm not sure if this |
@Gustry @nboisteault @josemvm is the Video.del.23-01-2025.16.45.25.webmwhen I add the option |
|
that's what I need to do, but in 3.7.14 this work normally despite of how It works (or better, doesn't works) in 3.8.4. This because of in 3.7.14, |
I'm repeating myself but it only happens with pdfs and only in 3.8.4 |
We have made some changes in Lizmap 3.8.x to improve security against XSS. We'll accept a PR which improves PDF integration if it does not decrease security. |
So it's insecure to call pdf-viewer on popup open or in dock open? |
@Antoviscomi can you send the @nboisteault any chance to recover this functionality? |
@josemvm both in Chrome as in FF if I try to pass pdf-viewer via Maptip it becomes sanitized/purified (I don't know why) I'm also trying to allow via Popup.js and Utils.js according to |
@Antoviscomi thanks |
@Antoviscomi when i editing the html string in browser console this turns into:
and doesn´t work... |
have you tried to build Javascript ? https://github.com/3liz/lizmap-web-client/blob/master/CONTRIBUTING.md#building-javascript-only |
@Gustry yes of course with no errors but I dont understand why the pdf it seems yet not allowed. There is any step after js compilation I need to follow? I.e. |
Possibly but as usual it needs time, so funds or PRs are welcome. |
@nboisteault I'm trying to test an integration if it work I'll propose my PR |
This is for installation. Have you tried the docker setup ? It's pretty straight forward. |
No, @Gustry I've not! Because I work on a vm proxy exposed on the LAN, i don't need another (docker) IP to manage 😅 |
@Antoviscomi did you try something like this (certainly yes):
|
@josemvm yes I tried it but the DOMPurify acts on every .pdf locking it when is passed by an url or a php. I tried to create a new class pdf-frame container inside the popup, passing it a server-side encoded pdf (on html page) but nothing! The CORS and the policy adopted to avoid XSS don't allow/permit any type of pdf or pdf/application to work in iframe or object. I'm very discouraged |
i think so too i think this is an overzealous approach to security within a popup or within a table there are more pertinent security issues such as 2FA - it's just my opinion we hope that 3liz team can fix this issue without compromising security thanks to all |
@Gustry @nboisteault @josemvm
The tests I did are based on a Postgis layer to allow the dynamic choice of encoded pdfs directly from QGIS html Maptip (necessary because the html pages also have the encoded name to avoid DOMPurify sanitizing them because of the .pdf in the extension). Video.del.03-02-2025.16.44.39.webm |
What is the bug? (in English)
LWC 3.7.11
![imagem](https://private-user-images.githubusercontent.com/10053874/376347954-e91e5528-cc3b-4f93-a4be-343fc97c9bec.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4ODcxNzgsIm5iZiI6MTczODg4Njg3OCwicGF0aCI6Ii8xMDA1Mzg3NC8zNzYzNDc5NTQtZTkxZTU1MjgtY2MzYi00ZjkzLWE0YmUtMzQzZmM5N2M5YmVjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA3VDAwMDc1OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY0ZDdkMWRmYmRjZmQ4NmNiMDM4NTI4YWZhM2U4ZmI2MDhkYjkzNzM4MzA1MTY2NDY4OGMzMGU1MmI3N2NkNDcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.3AJnGnnyc9dqfDC115hbxsf7VJgmJ08hblM0CHNvs_o)
popup shows iframe in second table
LWC 3.8.3-pre
![imagem](https://private-user-images.githubusercontent.com/10053874/376348745-558c4278-85b4-42ce-a847-9a0f3abaeb55.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4ODcxNzgsIm5iZiI6MTczODg4Njg3OCwicGF0aCI6Ii8xMDA1Mzg3NC8zNzYzNDg3NDUtNTU4YzQyNzgtODViNC00MmNlLWE4NDctOWEwZjNhYmFlYjU1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA3VDAwMDc1OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWEzZGQyYTk1NjVmZmM0NTZkOWVkOTdiNGJkMzgwZjlmMDk2MjY5YjUxODdjZjY1MzI0NTUxYjc4MjM1NzY5MDkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.zcoPgTApVF_wWB67DV2J76RVVxRDeYqN0V00nOamsyw)
popup doesn´t show iframe in second table
LWC 3.7.11 and LWV 3.8.3-pre
![imagem](https://private-user-images.githubusercontent.com/10053874/376350746-45326f3d-986f-498f-aa52-e5a00fb940c7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4ODcxNzgsIm5iZiI6MTczODg4Njg3OCwicGF0aCI6Ii8xMDA1Mzg3NC8zNzYzNTA3NDYtNDUzMjZmM2QtOTg2Zi00OThmLWFhNTItZTVhMDBmYjk0MGM3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA3VDAwMDc1OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFjYzlhOTkwNmQwOGFkOGE0MTE2YzE3YzU3YjI5MmUyN2EwZTNkNWQxMWE4MGJiZTlmOWRkNjUzODNjY2M2YzgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.pYAQwK-GBJYleB1kBjigLu2ekGKjh3Nj7SlQ3PqfnVE)
data - everything works fine
Steps to reproduce the issue
try beteween these versions
Versions, safeguards, check summary etc
Versions :
List of Lizmap Web Client modules :
* multiauth : 1.2.2
List of safeguards :
* Mode : normal * Allow parent folder : no * Prevent other drive : no * Prevent PG service : no * Prevent PG Auth DB : no * Force PG user&pass : no * Prevent ECW : no
Check Lizmap plugin
Operating system
Ubuntu 22.04
Browsers
Firefox
Browsers version
131.0.2
Relevant log output
No response
The text was updated successfully, but these errors were encountered: