Skip to content
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

Downloads inside HTML5 apps do not work #11987

Open
jredrejo opened this issue Mar 13, 2024 · 7 comments
Open

Downloads inside HTML5 apps do not work #11987

jredrejo opened this issue Mar 13, 2024 · 7 comments
Labels
APP: Learn Re: Learn App (content, quizzes, lessons, etc.) bug Behavior is wrong or broken P2 - normal Priority: Nice to have TODO: needs decisions Design or specifications are necessary

Comments

@jredrejo
Copy link
Member

jredrejo commented Mar 13, 2024

Observed behavior

Some HTML5 apps include content that can be donwloaded, as documentation, images, etc.
Current iframe sandbox in Kolibri blocks them.

Errors and logs

Just clicking on a download link does not produce any effect

There is an allow-downloads attribute for iframe that might be enabled globally in Kolibri to allow this.

Expected behavior

Clicking in a link to download a resource should work inside HTML5 apps

As this introduces security issues in some cases ( it would allow HTML5 apps to initiate downloads programmatically as well as through user interaction), the ideal solution would be adding an option to the HTML5AppNode to use it (being false by default)

User-facing consequences

Users can not use all the contents the app includes

Steps to reproduce

For example, courses or tutorial including documentation for further reading
image
don't allow this documentation to be downloaded, even if the document is included in the HTML5AppNode

Context

kolibri 0.16.0

@jredrejo jredrejo added bug Behavior is wrong or broken P2 - normal Priority: Nice to have TODO: needs decisions Design or specifications are necessary APP: Learn Re: Learn App (content, quizzes, lessons, etc.) labels Mar 13, 2024
@jredrejo jredrejo changed the title [Brief description] Downloads inside HTML5 apps do not work Mar 13, 2024
@poju3185
Copy link
Contributor

poju3185 commented Mar 17, 2024

Hi @jredrejo, could you give me an example of such html5 app?

@jredrejo
Copy link
Member Author

Hi @jredrejo, could you give me an example of such html5 app?

Yes, @poju3185 here's one: https://articulateusercontent.com/review/uploads/cPj4SORrydR49zuKNHfjfUrAe2RyfIyd/DxkvFL4f/index.html#/lessons/HCQgFWFRBDiv8VRaUq_uEDqzaF-57tXg

Anyway, it's important to understand the broader implications of enabling downloads through iframes. This goes beyond a simple code change.

Implementing this change would require:

Finally, the most crucial aspect is mitigating the risk of malicious content. How can we ensure uploaded content doesn't cause harm, and how much can we trust imported content? Cryptography might be a solution, but allowing anyone to upload apps with download capabilities opens up security vulnerabilities.

As you can see, this is a complex feature with significant technical and architectural considerations. Its feasibility needs careful evaluation.

@poju3185
Copy link
Contributor

Thank you for the detailed explanation! Given the complexity and the careful evaluation needed to ensure both functionality and security, I think I'll sit this one out and observe for now. I look forward to seeing how this develops and learning from the process.
P.S. I am able to download the attachment file in the provided link. Is this the expected behavior?

@jredrejo
Copy link
Member Author

P.S. I am able to download the attachment file in the provided link. Is this the expected behavior?

yes, but if this html app is added in a channel for kolibri you can't , that's what this issue tries to change

@poju3185
Copy link
Contributor

I see. Thank you.

@Wck-iipi
Copy link
Contributor

@jredrejo I see that this issue has the tag TODO:needs decision. But you have specified in great detail on what to do. If this issue is up for grabs, I would like to solve this issue.

@rtibbles
Copy link
Member

There's still a strong concern here about the potential for malicious behaviour. Loosening the sandbox, even selectively, would allow programmatically initiated downloads as well as user initiated ones.

I am not sure that allowing any loosening of the sandbox is actually desirable, but rather allowing non-renderable files to be included as separate file attachments, which the user can then choose to download via the user interface.

Either way, this issue is not ready for contribution, hence the needs decisions label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APP: Learn Re: Learn App (content, quizzes, lessons, etc.) bug Behavior is wrong or broken P2 - normal Priority: Nice to have TODO: needs decisions Design or specifications are necessary
Projects
None yet
Development

No branches or pull requests

4 participants