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

issue:#14 replaceAll addition #15

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sameer-555
Copy link

Hi team,
this is fix for issue #14, this is one of my first opensource contributions. please let know in case there are any corrections.

Copy link
Owner

@mvondracek mvondracek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, thank you for your PR. Your help and contribution is appreciated!

code: '$("div").append($("input").replaceAll("<script>"))',
errors: [{message: error, type: 'CallExpression'}]
}
]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replaceAll method is different than than the rest of unsafe methods. Calee and parameter are reversed, see https://api.jquery.com/replaceAll/.

$( "<script>" ).replaceAll( "div" );

In order to better understand this, try to create XSS-vulnerable code with replaceAll.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh alright, will check more on this and update accordingly.

@mvondracek
Copy link
Owner

Please be aware that changes are commited by @aishwarya-nagtilak08 account while the fork is owned by @sameer-555. Is this intentional?

@mvondracek
Copy link
Owner

Closes #14 after merge.

@mvondracek mvondracek linked an issue Feb 11, 2023 that may be closed by this pull request
2 tasks
@mvondracek mvondracek marked this pull request as draft February 11, 2023 10:47
@mvondracek
Copy link
Owner

This might be related to mvondracek/jQuery-XSS#7 in case you would like to look into that as well.

@sameer-555
Copy link
Author

That wasn't intentional but expected since I was using my girlfriend's laptop.

@sameer-555
Copy link
Author

mvondracek/jQuery-XSS#7 I'll look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add replaceAll method
3 participants