WordPress / WordPress/theme-check
Escape and sanitize untrusted data [Warning]
Open
Nobody has claimed this yet.
sniffer
- Dominant language
- PHP
- Stars
- 371
- Forks
- 113
- Avg merge
- 8m
- Merged PRs (30d)
- 5
Description
There are a few checks that we can run that could help catch a few of the main issues.
- Sanitize widget settings in the
update()function in the widget class e.g.$instance['example'] = $new_instance['example']; - Check if
$_POST,$_GET$_REQUESTare wrapped in a bracket e.g.isset( $_POST['example] )oresc_html( $_GET['example'] )
I am sure there are a few more that will come to mind.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the widget class's update() function and the checks that inspect $_POST, $_GET, and $_REQUEST usage. Review the listed unsanitized widget-setting and unwrapped request examples, then define the additional cases to detect. Done means the checker reliably identifies the described unsafe patterns and covers the agreed additional cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- security, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100