Opened 4 years ago
Closed 4 years ago
#56117 closed defect (bug) (invalid)
Need escaping in class-wp-rest-widget-types-controller file
| Reported by: | priyankkpatel | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | REST API | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
in /wp-includes/rest-api/endpoints/class/class-wp-rest-widget-types-controller.php file, need escaping on function render_legacy_widget_preview_iframe.
Attaching patch for the same.
Attachments (1)
Change History (4)
#2
in reply to: ↑ 1
@
4 years ago
Hi, @TimothyBlynJacobs ,
I think since it's a request parameter from the function itself we can escape these values while calling.
#3
@
4 years ago
- Milestone Awaiting Review
- Resolution → invalid
- Status new → closed
WordPress practices late escaping. In other words, unsafe values should be escaped as close to their output as possible. Preemptively escaping every value that is passed to a function would be unnecessary and can sometimes lead to security issues itself.
Instead, you'd need to look at the function being called, render_block_core_legacy_widget and evaluate if there were any places where output was generated without being properly escaped.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Hi @priyankkpatel,
Why should these values be escaped?