Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#44115 closed defect (bug) (fixed)

Add `esc_html` to get_comment_link

Reported by: 1naveengiri's profile 1naveengiri Owned by: iandunn's profile iandunn
Milestone: 4.9.7 Priority: normal
Severity: normal Version:
Component: Comments Keywords: fixed-major
Focuses: administration Cc:

Description

At https://core.trac.wordpress.org/browser/branches/4.9/src/wp-admin/edit-form-comment.php#L27
get_comment_link( ) function getting used without esc_html( )

Attachments (1)

44115.patch (593 bytes) - added by 1naveengiri 7 years ago.
Adding a patch for it

Download all attachments as: .zip

Change History (9)

@1naveengiri
7 years ago

Adding a patch for it

#1 @iandunn
7 years ago

Related ticket:44054#comment:2

In the future, please disclose any missing escape privately, via HackerOne, rather than publicly via Trac.

#2 @joyously
7 years ago

  • Keywords needs-patch added

The patch is incorrect. It should be the output that is changed.

<span id="sample-permalink"><a href="<?php echo esc_url( $comment_link ); ?>"><?php echo esc_html( $comment_link ); ?></a></span>

#3 @iandunn
7 years ago

  • Owner set to iandunn
  • Resolution set to fixed
  • Status changed from new to closed

In 43290:

Comments: Escape permalink values on edit screen to prevent XSS.

There doesn't appear to be any way for an attacker to introduce malicious input into the URL, unless a plugin is filtering the URL to add it, but it's better to be safe than sorry.

Props 1naveengiri, joyously.
Fixes #44115.

#4 @johnbillion
7 years ago

  • Component changed from General to Comments
  • Focuses administration added
  • Milestone changed from Awaiting Review to 5.0
  • Version trunk deleted

#5 @johnbillion
7 years ago

  • Keywords fixed-major added; needs-patch removed
  • Milestone changed from 5.0 to 4.9.7
  • Resolution fixed deleted
  • Status changed from closed to reopened

#6 @SergeyBiryukov
7 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 43301:

Comments: Escape permalink values on edit screen to prevent XSS.

There doesn't appear to be any way for an attacker to introduce malicious input into the URL, unless a plugin is filtering the URL to add it, but it's better to be safe than sorry.

Props 1naveengiri, joyously.
Merges [43290] to the 4.9 branch.
Fixes #44115.

#7 @desrosj
7 years ago

  • Milestone changed from 4.9.7 to 4.9.8

Moving all tickets in 4.9.7 to 4.9.8.

#8 @SergeyBiryukov
7 years ago

  • Milestone changed from 4.9.8 to 4.9.7

Moving already backported tickets back to 4.9.7.

Note: See TracTickets for help on using tickets.