Commit dc9c161
Fix SQL injection vulnerability in posts_clauses method (#7)
* Fix SQL injection vulnerability in posts_clauses method
- Sanitize post_parent parameter using absint() before use in SQL
- Use $wpdb->prepare() with %d placeholder for post_parent value
- Fix logic for unattached attachments (string '0' from request now works)
- Harden taxonomy join by using sanitize_key() and $wpdb->prepare()
Security: Prevents time-based SQL injection via query[post_parent] parameter
that was exploitable by authenticated users (Author role and above).
Co-Authored-By: yoren@shikadigital.co.jp <yorenchang@gmail.com>
* Use $wpdb->prepare() for post_parent = 0 case for consistency
Address review feedback: use prepared statement for the hardcoded 0 value
to maintain consistency with the rest of the codebase.
Co-Authored-By: yoren@shikadigital.co.jp <yorenchang@gmail.com>
* Bump version to 0.9.2 and update changelog
- Security enhancements
Co-Authored-By: yoren@shikadigital.co.jp <yorenchang@gmail.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: yoren@shikadigital.co.jp <yorenchang@gmail.com>1 parent 5d68e97 commit dc9c161
File tree
3 files changed
+16
-9
lines changed- public
3 files changed
+16
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
68 | 71 | | |
69 | 72 | | |
70 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
161 | 164 | | |
162 | 165 | | |
163 | 166 | | |
| |||
207 | 210 | | |
208 | 211 | | |
209 | 212 | | |
210 | | - | |
| 213 | + | |
| 214 | + | |
211 | 215 | | |
212 | 216 | | |
213 | 217 | | |
| |||
0 commit comments