Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Tests: Add tests for recently fixed manipulation XSS issues#4685

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mgol merged 1 commit intojquery:masterfrommgol:manip-security-tests
Apr 29, 2020

Conversation

mgol
Copy link
Member

Summary

Add tests for recently fixed manipulation XSS issues.
Refgh-4642
Refgh-4647

Checklist

@mgolmgol added Needs review Tests Discuss in MeetingReserved for Issues and PRs that anyone would like to discuss in the weekly meeting. labelsApr 23, 2020
@mgolmgol added this to the3.5.1 milestoneApr 23, 2020
@mgolmgol self-assigned thisApr 23, 2020
assert.ok( window.xss.withArgs( currCounter ).notCalled,
"Insecure code wasn't executed, input: " + htmlString );
done();
}, 1000 );
Copy link
Member

Choose a reason for hiding this comment

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

It would be nice to reduce this forced one-second frequency... what would you think about something like so?

div.appendTo(container);div.html(htmlString);container.append("<img src=x onerror=\"xssDone(counter)\">")

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I'll try that, thanks!

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

@gibson042 Now that I think about it... How do we know thisonerror callback will be fired as the last one? 404 responses may not be cached AFAIK so there's a risk that one will fire before the other ones are done.

Copy link
Member

Choose a reason for hiding this comment

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

Well,src="#" would guarantee that the invalid source is cached.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

That will resolve to the current page, though, so it won't be a 404.

Also, currently all the tests succeed even if cache is disabled in the browser DevTools. I'd like to keep that working.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

@gibson042 I'm thinking about ways to reduce this delay but if I don't find anything reliable that'd work with cache disabled, I think I'll just merge it, we can always apply improvements later.

Copy link
Member

Choose a reason for hiding this comment

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

We don't need a 404, just need a response that isn't a successful image. And I don't see any cache concerns, but if you want to merge without the acceleration then I won't object.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Good point about not needing 404s. I tested your suggestion, though, and - if I understood it correctly - it looks like I was right about race conditions. See the code at:
mgol@7cd593f
I reverted the two security fixes locally & all assertions should fail but it's pretty random for me; on each refresh different ones are failing for me. I tried theesmodules tests.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

An example test run below, I only run this single test. Note that the order of reported assertions is also pretty random.
Screen Shot 2020-04-28 at 23 46 05

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, raciness confirmed. I don't think that's fatal to the testing, but it would require restructuring. No worries.

@mgolmgolforce-pushed themanip-security-tests branch fromccadbc6 to40cd040CompareApril 27, 2020 21:26
@timmywiltimmywil removed the Discuss in MeetingReserved for Issues and PRs that anyone would like to discuss in the weekly meeting. labelApr 28, 2020
@mgolmgolforce-pushed themanip-security-tests branch from40cd040 tof9983f1CompareApril 28, 2020 21:50
@mgolmgolforce-pushed themanip-security-tests branch fromf9983f1 to75429b4CompareApril 29, 2020 14:33
@mgolmgol merged commitdc06d68 intojquery:masterApr 29, 2020
@mgolmgol deleted the manip-security-tests branchApril 29, 2020 14:39
mgol added a commit that referenced this pull requestApr 29, 2020
mgol added a commit to mgol/jquery that referenced this pull requestApr 29, 2020
iOS 8-12 parses `<noembed>` tags differently, executing this code. This is nodifferent to native behavior on that OS, though, so just accept it.Refjquerygh-4685
@mgol
Copy link
MemberAuthor

Looks like one of the added tests fails in iOS 8 - 12. A followup fix PR, PTAL:#4694.

@mgolmgol mentioned this pull requestApr 30, 2020
mgol added a commit that referenced this pull requestApr 30, 2020
iOS 8-12 parses `<noembed>` tags differently, executing this code. This is nodifferent to native behavior on that OS, though, so just accept it.Refgh-4685Closesgh-4694
mgol added a commit that referenced this pull requestApr 30, 2020
iOS 8-12 parses `<noembed>` tags differently, executing this code. This is nodifferent to native behavior on that OS, though, so just accept it.Refgh-4685Closesgh-4694(cherry picked from commit11066a9)
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@gibson042gibson042gibson042 approved these changes

@timmywiltimmywiltimmywil approved these changes

Assignees

@mgolmgol

Labels
Milestone
3.5.1
Development

Successfully merging this pull request may close these issues.

3 participants
@mgol@timmywil@gibson042

[8]ページ先頭

©2009-2025 Movatter.jp