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

react-script-editor - cannot add two body #5196

Closed
9 tasks
RickyLeungFWD opened this issue Aug 6, 2024 · 2 comments
Closed
9 tasks

react-script-editor - cannot add two body #5196

RickyLeungFWD opened this issue Aug 6, 2024 · 2 comments
Labels
sample: react-script-editor type:bug-suspected Suspected bug (not working as designed/expected). See type:bug-confirmed for confirmed bugs

Comments

@RickyLeungFWD
Copy link

Disclaimer

Yes

Sample

react-script-editor

Contributor(s)

@wobba @salascz @felixbohnacker

What happened?

And we are not looking for perfect bug prevention offering from the "Javascript Editor", but 2 tags issue indicates that the "Javascript Editor" have high risk of insecure html code injection.

Steps to reproduce

#1. Add the scripts to the "Script Editor", save, and publish
#2. open the page, the invalid formatted html is loaded to the page.

<title>Javascript inject issue 02</title> <style> body { font-family: Arial, sans-serif; } </style>

javascript inject testing

<script> function gpShowAlert() { console.info('javascript at invalid location 02'); } gpShowAlert(); </script>

Expected behavior

invalid html should not be loaded successfully.

Target SharePoint environment

SharePoint Online

Developer environment

Windows

Browsers

  • Internet Explorer
  • Microsoft Edge
  • Google Chrome
  • FireFox
  • Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

What version of Node.js is currently installed on your workstation?

we only is sharepoint online does not work

What version of Node.js is required by the sample?

we only is sharepoint online does not work

Paste the results of SPFx doctor

run this on sharepoint admin site?

Additional environment details

No response

@RickyLeungFWD RickyLeungFWD added the type:bug-suspected Suspected bug (not working as designed/expected). See type:bug-confirmed for confirmed bugs label Aug 6, 2024
@wobba
Copy link
Contributor

wobba commented Aug 7, 2024

😂 sorry for the laugh emoji, but this web part is all about script/html/css injection, and why you should not use it in the first place. Called out in the readme https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-script-editor/README.md#deploy-to-non-script-sites--modern-team-sites

And you can inject on any tag as the entire DOM is available.

@hugoabernier hugoabernier closed this as not planned Won't fix, can't repro, duplicate, stale Sep 1, 2024
@RickyLeungFWD
Copy link
Author

😂 sorry for the laugh emoji, but this web part is all about script/html/css injection, and why you should not use it in the first place. Called out in the readme https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-script-editor/README.md#deploy-to-non-script-sites--modern-team-sites

And you can inject on any tag as the entire DOM is available.

yes i understand

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sample: react-script-editor type:bug-suspected Suspected bug (not working as designed/expected). See type:bug-confirmed for confirmed bugs
Projects
None yet
Development

No branches or pull requests

3 participants