Opened 2 years ago
Closed 2 years ago
#56696 closed defect (bug) (fixed)
Multiple Themes: Correctly escape stylesheet URL
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.1 | Priority: | normal |
Severity: | normal | Version: | 3.2 |
Component: | Bundled Theme | Keywords: | has-patch commit |
Focuses: | Cc: |
Description (last modified by )
IN 'wp-content/themes/twentyeleven/header.php' on line '52' I've found that "bloginfo( 'stylesheet_url' )" was used without escaping. I know it's a silly issue. But I think we can improve it by escaping the URL for more consistency.
This has been discussed with a security team member who verified it's suitable as a public hardening issue.
Attachments (6)
Change History (18)
#2
@
2 years ago
- Description modified (diff)
- Summary changed from This has been discussed with a security team member who verified it's suitable as a public hardening issue. to Twenty Eleven: Correctly escape stylesheet URL
#3
@
2 years ago
- Keywords changes-requested added
Hi @alberuni-azad, thanks for the patch! Can you update the patch so that this
esc_url( bloginfo( 'stylesheet_url' ) );
is changed to:
echo esc_url( get_bloginfo( 'stylesheet_url' ) );
Thanks!
#4
@
2 years ago
Hi @costdev
Uploaded another patch https://core.trac.wordpress.org/attachment/ticket/56696/56696.3.diff
Please check now.
Thanks!
#5
@
2 years ago
- Could we use the
get_stylesheet_uri()
function instead ofget_bloginfo
? - The stylesheet version date will be updated on #56450 (already mentioned in PR 3148 review).
- The same escaping could be added in Twenty Ten's header.php.
- The template directory function is also unescaped for Twenty Twelve to Twenty Fourteen, but we may remove those HTML5 scripts soon anyway (#56699). Twenty Fifteen already escapes the function.
#6
@
2 years ago
Hi @sabernhardt
- Since
get_bloginfo( 'stylesheet_url' )
function using theget_stylesheet_uri()
we can directly call that function instead of the bloginfo function. - I'm unsure which version this patch will be added, so I think once the ticket is confirmed, we can update the version date.
3 & 4. Yes, I've checked those files and noticed that the function is unescaped. Should I upload another patch for those themes too?
Anyway, Thank you so much for reviewing this ticket.
#7
@
2 years ago
If you would like to create patches for the other themes, too, that would be good :)
Then a committer can decide to change any or all of the themes.
Perhaps you could leave the stylesheet's modified date for now, to be edited on #56450 (or a later ticket) within days of the final release.
#8
@
2 years ago
@sabernhardt
I've uploaded 2 different patches. No 4 for the Twenty eleven and 5 no for the Twenty twelve, thirteen, and fourteen themes.
#9
@
2 years ago
- Keywords changes-requested removed
- Milestone changed from Awaiting Review to 6.1
- Owner set to desrosj
- Status changed from new to reviewing
#11
@
2 years ago
- Keywords commit added
- Summary changed from Twenty Eleven: Correctly escape stylesheet URL to Multiple Themes: Correctly escape stylesheet URL
56696.6.diff has a few more instances of this issue.
Created patch.