Commit 59f4cf8
Add
This change fixes an RCE security vulnerability that occurs if the Fiddle flags come from an untrusted or less-trusted source.
This change exposes the `allow_imports` option in `DEFINE_fiddle_config`, and defaults it to `False` (previous behavior was implicitly `True`); as well as changing the default value of this option in the underlying `FiddleFlag` class from `True` to `False`. This prevents Fiddle from implicitly loading modules and executing code when dotted names are passed, such as `--config=config:foo.bar()`.
**If this change broke you**: the easiest fix is to add `allow_imports=True` to your `DEFINE_fiddle_config`. This will revert your code to the previous behavior. However, if possible we recommend that you instead place all the functions you might need into one module, and set `default_module` to that.
PiperOrigin-RevId: 879723838allow_imports option to DEFINE_fiddle_config etc., default False
1 parent 24c1d2e commit 59f4cf8
1 file changed
+30
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
138 | 146 | | |
139 | 147 | | |
140 | 148 | | |
| |||
239 | 247 | | |
240 | 248 | | |
241 | 249 | | |
242 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
243 | 265 | | |
244 | 266 | | |
245 | 267 | | |
| |||
267 | 289 | | |
268 | 290 | | |
269 | 291 | | |
| 292 | + | |
270 | 293 | | |
271 | 294 | | |
272 | 295 | | |
| |||
325 | 348 | | |
326 | 349 | | |
327 | 350 | | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
328 | 355 | | |
329 | 356 | | |
330 | 357 | | |
| |||
338 | 365 | | |
339 | 366 | | |
340 | 367 | | |
| 368 | + | |
341 | 369 | | |
342 | 370 | | |
343 | 371 | | |
| |||
0 commit comments