Commit 8a2579c
authored
fix: prevent ORM field injection via segment parameter in analytics (GHSA-93x3-ghh7-72j3) (#8864)
* fix: prevent ORM field injection via segment parameter in analytics (GHSA-93x3-ghh7-72j3)
Centralize analytics field allowlists into VALID_ANALYTICS_FIELDS and
VALID_YAXIS constants in analytics_plot.py. Add defense-in-depth
validation in build_graph_plot() and extract_axis() so no caller can
pass arbitrary field references to Django F() expressions. Add missing
segment validation to SavedAnalyticEndpoint. Also fixes ExportAnalytics
using "estimate_point" instead of "estimate_point__value".
* fix: address PR review - remove unused imports and validate stored query params
Remove unused VALID_ANALYTICS_FIELDS and VALID_YAXIS imports from
analytic_plot_export.py. Add x_axis/y_axis allowlist validation in
SavedAnalyticEndpoint for stored query_dict values to prevent 500
errors from malformed saved analytics.1 parent 7c2fc2d commit 8a2579c
2 files changed
Lines changed: 40 additions & 41 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | 44 | | |
62 | | - | |
| 45 | + | |
63 | 46 | | |
64 | 47 | | |
65 | 48 | | |
66 | 49 | | |
67 | 50 | | |
68 | 51 | | |
69 | | - | |
| 52 | + | |
70 | 53 | | |
71 | 54 | | |
72 | 55 | | |
| |||
214 | 197 | | |
215 | 198 | | |
216 | 199 | | |
217 | | - | |
| 200 | + | |
218 | 201 | | |
219 | | - | |
| 202 | + | |
220 | 203 | | |
221 | 204 | | |
222 | 205 | | |
223 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
224 | 214 | | |
225 | 215 | | |
226 | 216 | | |
| |||
236 | 226 | | |
237 | 227 | | |
238 | 228 | | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | 229 | | |
257 | | - | |
| 230 | + | |
258 | 231 | | |
259 | 232 | | |
260 | 233 | | |
261 | 234 | | |
262 | 235 | | |
263 | 236 | | |
264 | | - | |
| 237 | + | |
265 | 238 | | |
266 | 239 | | |
267 | 240 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
25 | 42 | | |
26 | 43 | | |
27 | 44 | | |
| |||
34 | 51 | | |
35 | 52 | | |
36 | 53 | | |
| 54 | + | |
| 55 | + | |
37 | 56 | | |
38 | 57 | | |
39 | 58 | | |
| |||
52 | 71 | | |
53 | 72 | | |
54 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
55 | 81 | | |
56 | 82 | | |
57 | 83 | | |
| |||
0 commit comments