Make WordPress Core

Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#44115 closed defect (bug) (fixed)

Add `esc_html` to get_comment_link

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

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 9 years ago.
Adding a patch for it

Download all attachments as: .zip

Change History (9)

@1naveengiri
9 years ago

Adding a patch for it

#1 @iandunn
9 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
9 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
9 years ago

  • Owner set to iandunn
  • Resolution → fixed
  • Status new → 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
9 years ago

  • Component General → Comments
  • Focuses administration added
  • Milestone Awaiting Review → 5.0
  • Version trunk

#5 @johnbillion
9 years ago

  • Keywords fixed-major added; needs-patch removed
  • Milestone 5.0 → 4.9.7
  • Resolution fixed
  • Status closed → reopened

#6 @SergeyBiryukov
8 years ago

  • Resolution → fixed
  • Status reopened → 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
8 years ago

  • Milestone 4.9.7 → 4.9.8

Moving all tickets in 4.9.7 to 4.9.8.

#8 @SergeyBiryukov
8 years ago

  • Milestone 4.9.8 → 4.9.7

Moving already backported tickets back to 4.9.7.

Note: See TracTickets for help on using tickets.