Ethan 1238d614e1 Merge pull request from GHSA-xjcj-p2qv-q3rf
* Update render.js

# Improved handling of mustache expressions and v-pre attribute assignment

## Changes Made:
- Ensured that the parent tag of such text nodes is explicitly set to a `<p>` tag with the `v-pre` attribute.
- Added debug messages for better understanding of the script execution flow [THIS SHOULD REMOVED WHEN PUSHING TO PRODUCTION].

## Why it Works:
- When a mustache expression is found, the script either wraps it in a new `<p>` tag with the `v-pre` attribute or adds the `v-pre` attribute to the existing parent `<p>` tag.
- This approach ensures that the template code is not removed but encapsulated within `<p>` tags with the `v-pre` attribute, as required.

## Test Cases Passed:
1. `<xyz>{{ constructor.constructor('alert(1)')() }}</xyz>`
2. `<xyz>{{ constructor.constructor('alert(1)')() }}</xyz>`
3. `<p><xyz>{{ constructor.constructor('alert(1)')() }}</p>`
4. `<p><xyz>{{ constructor.constructor('alert(1)')() }}</xyz></p>`
5. `<p>&lt;xyz&gt;{{constructor.constructor('alert("Test Case 8")')()}}&lt;xyz&gt;{{constructor.constructor('alert("Test Case 9")')()}}&lt;/xyz&gt;</p>`

This commit enhances the robustness and reliability of handling mustache expressions and ensures proper assignment of the `v-pre` attribute, to ensure that there is no room for the weaponization of the template code later in the rendering process.

* fix: move template expressions after dom-purify + handle text nodes without parent

---------

Co-authored-by: NGPixel <github@ngpixel.com>
2024-05-13 14:57:17 -04:00
2024-04-29 15:12:22 -04:00
2021-10-15 22:29:01 -04:00
2020-07-05 15:59:02 -04:00
2019-08-04 13:54:23 -04:00
2019-08-26 22:54:02 -04:00
2017-08-12 17:26:27 -04:00
2023-08-10 17:15:02 -04:00
2020-07-05 16:13:40 -04:00
2016-08-16 15:35:26 -04:00
2024-04-29 17:12:17 -04:00
2024-04-29 14:24:28 -04:00

Wiki.js

Release License Standard - JavaScript Style Guide Downloads Docker Pulls
Build + Publish Huntr GitHub Sponsors Open Collective backers and sponsors
Chat on Slack Follow on Twitter Follow on Telegram Chat on Discord Reddit

A modern, lightweight and powerful wiki app built on NodeJS

Follow our Twitter feed to learn about upcoming updates and new releases!

Donate

Wiki.js is an open source project that has been made possible due to the generous contributions by community backers. If you are interested in supporting this project, please consider becoming a sponsor, becoming a patron, donating to our OpenCollective, via Paypal or via Ethereum (0xe1d55c19ae86f6bcbfb17e7f06ace96bdbb22cb5).

Become a Sponsor Become a Patron Donate on OpenCollective Donate via Paypal
Donate via Ethereum Donate via Bitcoin Buy a T-Shirt

Gold Tier Sponsors

GitHub Sponsors

Support this project by becoming a sponsor. Your name will show up in the Contribute page of all Wiki.js installations as well as here with a link to your website! [Become a sponsor]

Alexander Casassovici
(@alexksso)
Broxen
(@broxen)
Dacon
(@xDacon)
Jay Daley
(@JayDaley)
Oleksii
(@idokka)

OpenCollective Sponsors

Support this project by becoming a sponsor. Your logo will show up in the Contribute page of all Wiki.js installations as well as here with a link to your website! [Become a sponsor]

Patreon Backers

Thank you to all our patrons! 🙏 [Become a patron]

  • Aeternum
  • Al Romano
  • Alex Balabanov
  • Alex Milanov
  • Alex Zen
  • Arti Zirk
  • Ave
  • Brandon Curtis
  • Damien Hottelier
  • Daniel T. Holtzclaw
  • Dave 'Sri' Seah
  • djagoo
  • dz
  • Douglas Lassance
  • Ergoflix
  • Ernie Reid
  • Etienne
  • Flemis Jurgenheimer
  • Florent
  • Günter Pavlas
  • hong
  • Hope
  • Ian
  • Imari Childress
  • Iskander Callos
  • Josh Stewart
  • Justin Dunsworth
  • Keir
  • Loïc CRAMPON
  • Ludgeir Ibanez
  • Lyn Matten
  • Mads Rosendahl
  • Mark Mansur
  • Matt Gedigian
  • Mike Ditton
  • Nate Figz
  • Patryk
  • Paul O'Fallon
  • Philipp Schürch
  • Tracey Duffy
  • Quaxim
  • Richeir
  • Sergio Navarro Fernández
  • Shad Narcher
  • ShadowVoyd
  • SmartNET.works
  • Stepan Sokolovskyi
  • Zach Crawford
  • Zach Maynard
  • 张白驹

OpenCollective Backers

Thank you to all our backers! 🙏 [Become a backer]

Contributors

This project exists thanks to all the people who contribute. [Contribute].

Special Thanks

Browserstack
Browserstack for providing access to their great cross-browser testing tools.

Cloudflare
Cloudflare for providing their great CDN, SSL and advanced networking services.

DigitalOcean
DigitalOcean for providing hosting of the Wiki.js documentation site and APIs.

Icons8
Icons8 for providing access to their beautiful icon sets.

Localazy
Localazy for providing access to their great localization service.

Lokalise
Lokalise for providing access to their great localization tool.

MacStadium
MacStadium for providing access to their Mac hardware in the cloud.

Netlify
Netlify for providing hosting for our website.

ngrok
ngrok for providing access to their great HTTP tunneling services.

Porkbun
Porkbun for providing domain registration services.

Description
Wiki.js | A modern and powerful wiki app built on Node.js
Readme 45 MiB
Languages
Vue 47.6%
JavaScript 42.2%
SCSS 5%
HTML 2%
Shell 1.7%
Other 1.5%