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

Kiwix deployments that don't redirect arbitrary path to content path are vulnerable to XXS injection #605

Closed
ClevenL opened this issue Mar 14, 2023 · 4 comments
Assignees
Labels
Milestone

Comments

@ClevenL
Copy link

ClevenL commented Mar 14, 2023

Sorry for being a bit vague.
I have identified some deployments of Kiwix that do not redirect arbitrary path to content path and therefore are vulnerable to XSS injection.

Deployment like this would trigger an XXS with eg. payload:
https://kiwix.example.domain/%22%3E%3Cimg%20src=X%20onerror=alert(1)%3E
https://library.kiwix.org/%22%3E%3Cimg%20src=X%20onerror=alert(1)%3E

library.kiwix.org redirects correctly to content path where the input is correctly sanitized.
https://library.kiwix.org/content/%22%3E%3Cimg%20src=X%20onerror=alert(1)%3E

What would be a solution to redirect the path to content? Is there a missing configuration? Since I have identified several deployments with this kind of issue then the deployment process might need updating to avoid the misconfiguration.

@mgautierfr
Copy link
Member

mgautierfr commented Mar 14, 2023

What would be a solution to redirect the path to content?

The /content endpoint has been introduced in last release (12.0.0), so I would say : keep your deployement up to date :)

@kelson42 kelson42 added this to the 3.5.0 milestone Mar 14, 2023
@opk12
Copy link

opk12 commented Mar 22, 2023

  • Is kiwix-tools 3.1.2-3 from Debian bullseye (= current stable) also affected?
  • Shouldn't this warrant a CVE to inform downstream distributors and let them coordinate?

@kelson42
Copy link
Contributor

@mgautierfr Do you mean this bug is fixed or inoperant in latest version of kiwix-serve?

@mgautierfr
Copy link
Member

There was a (unknown at the time) bug in previous version where we was vulnerable to XSS injection.
With the introduction of the js viewer we have "fixed" this issue as we now correctly "sanitize" the input.

The fix is not especially related to the js viewer. Just that we have done things better when coding the /content endpoint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants