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

<amp-pinterest> Sanitize URLs #13885

Merged
merged 2 commits into from
Mar 8, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions extensions/amp-pinterest/0.1/pin-widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ export class PinWidget {
const log = el.getAttribute('data-pin-log');
if (href) {
if (shouldPop) {
openWindowDialog(window, href, '_pinit', POP);
openWindowDialog(window, encodeURI(href), '_pinit', POP);
Copy link
Contributor

Choose a reason for hiding this comment

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

This won't do it. I can still use a javascript:alert('PWNED'), which'll pass right through. We likely want something like assertAbsoluteHttpOrHttpsUrl.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Taken this out in favor of assertAbsoluteHttpOrHttpsUrl

} else {
openWindowDialog(window, `${href}?amp=1&guid=${Util.guid}`, '_blank');
openWindowDialog(window, encodeURI(href+'?amp=1&guid=$'+Util.guid), '_blank');
}
}
if (log) {
Expand Down