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

[bug] XSS use of ace.min.js #166

Closed
daniel-lewis-ab opened this issue Mar 29, 2024 · 6 comments
Closed

[bug] XSS use of ace.min.js #166

daniel-lewis-ab opened this issue Mar 29, 2024 · 6 comments
Assignees
Labels
type: 🐛 bug Something isn't working type: 🤚 feature request New feature or request

Comments

@daniel-lewis-ab
Copy link

Describe the bug

Hi, I'm working on a project that involves examining a bunch of the ComfyUI nodes' JS.

In comfyui_shared.js:417 and note_plus.js you use a loadScript() to load ace.min.js into the script. NotePlus node wasn't visible in utils. I've disabled the remote script import for our purposes but just wanted to point out the state it was found in. This may be an out of date version issue that's already been fixed in your main? Regardless, the external path thing is something that would probably be best localized for security reasons for most uses.

web/extern/shodown.js being deleted seems to not cause any errors at a cursory glance, and I'm not sure why it's there? Solving this riddle is flagged as one of my remaining issues before we can include your node in a large project.

Reproduction

The affected code is note_plus.js

Expected behavior

I would hope to see the ace.min.js call either localized to directory or removed altogether to prevent the possibility of the remote server being used as a vector of attack to other people's machines/browser experience/servers.

Operating System

Linux

Comfy Mode

Other (online services, containers etc..)

Console output

No response

Additional context

No response

@daniel-lewis-ab daniel-lewis-ab added status: 🧹 needs triage This issue needs to triage, applied to new issues type: 🐛 bug Something isn't working labels Mar 29, 2024
@melMass melMass removed the status: 🧹 needs triage This issue needs to triage, applied to new issues label Mar 29, 2024
@melMass
Copy link
Owner

melMass commented Mar 29, 2024

Good point yes it makes sense since I do for other externals.
Ace is used solely for the editing part of note plus and showdown is for rendering makrdown from note_plus and from the upcoming documentation widget

@melMass melMass added the type: 🤚 feature request New feature or request label Mar 29, 2024
@daniel-lewis-ab
Copy link
Author

daniel-lewis-ab commented Apr 2, 2024

#167

As mentioned, test before pulling.

@melMass
Copy link
Owner

melMass commented Apr 2, 2024

#167

As mentioned, test before pulling.

Thanks, given the nature of the PR (huge minified code..) I will do it myself.
I think it's also missing all the utility files (from cdn they are linked properly)
I will quickly look into it now, and if there are no blockers it should be solved soon

@daniel-lewis-ab
Copy link
Author

daniel-lewis-ab commented Apr 2, 2024 via email

@melMass melMass closed this as completed in 7c35582 Apr 2, 2024
@melMass
Copy link
Owner

melMass commented Apr 2, 2024

It was way more involving than planned since comfy preloads all the scripts in the web folder.
The trick was to add an extra static path to the server!
Let me know if it solves your security concerns

@daniel-lewis-ab
Copy link
Author

daniel-lewis-ab commented Apr 2, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: 🐛 bug Something isn't working type: 🤚 feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants