Make WordPress Core

Changeset 43301


Ignore:
Timestamp:
05/21/2018 12:39:54 PM (8 years ago)
Author:
SergeyBiryukov
Message:

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.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-admin/edit-form-comment.php

    r38616 r43301  
    3030    <div id="comment-link-box">
    3131        <strong><?php _ex( 'Permalink:', 'comment' ); ?></strong>
    32         <span id="sample-permalink"><a href="<?php echo $comment_link; ?>"><?php echo $comment_link; ?></a></span>
     32        <span id="sample-permalink">
     33            <a href="<?php echo esc_url( $comment_link ); ?>">
     34                <?php echo esc_html( $comment_link ); ?>
     35            </a>
     36        </span>
    3337    </div>
    3438</div>
Note: See TracChangeset for help on using the changeset viewer.