Opened 4 weeks ago
Last modified 4 weeks ago
#65076 new defect (bug)
Missing escaping in title tag
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Login and Registration | Keywords: | has-patch |
| Focuses: | coding-standards | Cc: |
Description (last modified by )
Missing escaping in <title> tag ⭐ TOP PICK
- File: [src/wp-login.php](src/wp-login.php#L97)
- Line: 97
- Problem:
<title>tag outputs$login_titlewithout escaping. Special characters could break HTML structure. - Severity: Security best practice
- Current Code:
<title><?php echo $login_title; ?></title>
- Fix:
<title><?php echo esc_html( $login_title ); ?></title>
Change History (7)
This ticket was mentioned in PR #11575 on WordPress/wordpress-develop by @maheshpatel.
4 weeks ago
#1
#2
@
4 weeks ago
The issue has been addressed and a fix has been implemented.
A pull request has been submitted for review: https://github.com/WordPress/wordpress-develop/pull/11575
Kindly take a look and share your feedback. Happy to make any required changes.
This ticket was mentioned in PR #11578 on WordPress/wordpress-develop by @opurockey.
4 weeks ago
#5
Ticket: https://core.trac.wordpress.org/ticket/65076
### Summary
This PR addresses multiple instances of improperly escaped output in wp-login.php. It ensures that dynamic strings are escaped at the point of output using appropriate WordPress escaping functions, aligning with core security best practices.
### Problem
Several strings in wp-login.php were output without proper escaping or with inconsistent escaping. This can lead to:
- Potential security risks (e.g., XSS vulnerabilities)
- Violation of WordPress coding standards regarding output escaping
WordPress recommends escaping data as late as possible (on output) to avoid issues like double-escaping or unsafe rendering.
### Solution
- Audited multiple output points in
wp-login.php - Applied appropriate escaping functions based on context:.
- Ensured consistency across all login-related messages and UI elements
### Impact
- Improves security by preventing unescaped output
- Aligns with WordPress Core coding standards
### Notes
- No backward compatibility issues expected
- Changes are limited to output escaping and do not alter logic or functionality
#6
@
4 weeks ago
Hi, Along with the originally reported issue, I’ve also fixed a few additional instances in wp-login.php where strings were not properly escaped or were inconsistently handled. These were updated to use the appropriate escaping functions based on context to ensure safer and more consistent output.
Let me know if you’d like me to split these into a separate PR or keep them as part of this fix.
#7
@
4 weeks ago
All. Please follow the instructions in the large box with the bolded title ARE YOU IN THE RIGHT PLACE? before submitting security-related tickets, and follow the security-reporting instructions.
Please continue this discussion in the appropriate place according to those instructions. Thank you for your contributions; there is a process for handling security issues though, which is why those warnings are everywhere.
Looking forward to getting your changes in!
Missing escaping in
<title>tag<title>tag outputs$login_titlewithout escaping. Special characters could break HTML structure.