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

Add context/path information to JSON-based string accesses #199

Closed
vladidx opened this issue Feb 7, 2024 · 7 comments
Closed

Add context/path information to JSON-based string accesses #199

vladidx opened this issue Feb 7, 2024 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@vladidx
Copy link
Member

vladidx commented Feb 7, 2024

JSON objects are often created from XHR responses and then flowing into the DOM (potentially without escaping).
It would be quite helpful to know the path/context of the tainted string within the JSON object, e.g. as part of the arguments:
image

Ideally, the context information would be a kind of XPath for JSON as described here.

@tmbrbr tmbrbr self-assigned this Feb 8, 2024
@tmbrbr tmbrbr added the enhancement New feature or request label Feb 8, 2024
@tmbrbr
Copy link
Contributor

tmbrbr commented Feb 8, 2024

@vladidx would you also need the entire JSON content as an additional argument, or do you have this information from e.g. the XHR response? Adding the entire JSON string as an argument might be quite memory intensive...

@vladidx
Copy link
Member Author

vladidx commented Feb 8, 2024

No, the JSON content is not needed

@tmbrbr
Copy link
Contributor

tmbrbr commented Feb 9, 2024

I'm working on a fix for this which would give:

"?.d.BookingExtension.BookingComment"

as the JSON Path for the above example. Would this be sufficient?

@vladidx
Copy link
Member Author

vladidx commented Feb 9, 2024

Yes, that would be already sufficient, thanks.

@tmbrbr
Copy link
Contributor

tmbrbr commented Feb 9, 2024

Ooops, just checked the spec again, I guess it should be a leading $ instead of a ?

@vladidx
Copy link
Member Author

vladidx commented Feb 9, 2024

👍

@tmbrbr
Copy link
Contributor

tmbrbr commented Feb 19, 2024

This is implemented with #200

@tmbrbr tmbrbr closed this as completed Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants