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

Zniffer search field allows modifying frame data #4117

Closed
3 tasks done
kpine opened this issue Feb 3, 2025 · 1 comment
Closed
3 tasks done

Zniffer search field allows modifying frame data #4117

kpine opened this issue Feb 3, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@kpine
Copy link
Contributor

kpine commented Feb 3, 2025

Checklist

  • I am not using Home Assistant. Or: a developer has told me to come here.
  • I have checked the troubleshooting section and my problem is not described there.
  • I have read the changelog and my problem is not mentioned there.

Deploy method

PKG executable

Z-Wave JS UI version

9.29.1

ZwaveJS version

14.3.7

Describe the bug

When attempting a search query in the Zniffer search field, I was able to apparently execute some JS code that modified the Type field for all frames.

Screenshot before search:

Image

Enter search query frame.type = "foobar" (my original query was frame.type = "ExplorerInclusionRequest", but that is more dramatic), and the type field of all messages has been replaced, apparently it has attempting to convert the string to an enum:

Image

To Reproduce

Enter a search term in the field that could modify something. Like frame.type = "foobar". You can basically modify any of the frame fields.

Expected behavior

The search term should not modify anything in the capture.

Preferably the search should be sanitized and validate the input, preventing any kind of code execution.

Additional context

Refreshing the web browser reloads the original content so it's only temporary.

@kpine kpine added the bug Something isn't working label Feb 3, 2025
@kpine kpine changed the title Zniffer search field allows arbitrary JS code execution Zniffer search field allows modifying frame data Feb 3, 2025
@robertsLando
Copy link
Member

LOL that's because that function is actually passed to a js filter, you should use == or === instead but I agree I should prevent allowing to change data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants