- Notifications
You must be signed in to change notification settings - Fork4.9k
Commitb68319c
committed
Use a separate interpreter for each calling SQL userid in plperl and pltcl.
There are numerous methods by which a Perl or Tcl function can subvertthe behavior of another such function executed later; for example, byredefining standard functions or operators called by the target function.If the target function is SECURITY DEFINER, or is called by such afunction, this means that any ordinary SQL user with Perl or Tcl languageusage rights can do essentially anything with the privileges of the targetfunction's owner.To close this security hole, create a separate Perl or Tcl interpreter foreach SQL userid under which plperl or pltcl functions are executed withina session. However, all plperlu or pltclu functions run within a sessionstill share a single interpreter, since they all execute at the trustlevel of a database superuser anyway.Note: this change results in a functionality loss when libperl has beenbuilt without the "multiplicity" option: it's no longer possible to callplperl functions under different userids in one session, since such alibperl can't support multiple interpreters in one process. However, sucha libperl already failed to support concurrent use of plperl and plperlu,so it's likely that few people use such versions with Postgres.Security:CVE-2010-34331 parent8ecec04 commitb68319c
File tree
6 files changed
+635
-378
lines changed- doc/src/sgml
- src/pl
- plperl
- tcl
6 files changed
+635
-378
lines changedLines changed: 6 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
145 | 145 |
| |
146 | 146 |
| |
147 | 147 |
| |
148 |
| - | |
149 |
| - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
150 | 154 |
| |
151 | 155 |
| |
152 | 156 |
| |
|
Lines changed: 42 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
261 | 261 |
| |
262 | 262 |
| |
263 | 263 |
| |
264 |
| - | |
265 |
| - | |
266 |
| - | |
267 |
| - | |
268 |
| - | |
269 |
| - | |
270 |
| - | |
271 |
| - | |
272 |
| - | |
273 |
| - | |
274 |
| - | |
275 |
| - | |
276 |
| - | |
277 |
| - | |
278 |
| - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
279 | 289 |
| |
280 | 290 |
| |
281 | 291 |
| |
| |||
313 | 323 |
| |
314 | 324 |
| |
315 | 325 |
| |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
316 | 343 |
| |
317 | 344 |
| |
318 | 345 |
| |
|
Lines changed: 36 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
199 | 199 |
| |
200 | 200 |
| |
201 | 201 |
| |
202 |
| - | |
203 |
| - | |
204 |
| - | |
205 |
| - | |
206 |
| - | |
207 |
| - | |
208 |
| - | |
| 202 | + | |
| 203 | + | |
209 | 204 |
| |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
210 | 232 |
| |
211 | 233 |
| |
212 | 234 |
| |
213 | 235 |
| |
214 | 236 |
| |
215 | 237 |
| |
216 | 238 |
| |
217 |
| - | |
218 |
| - | |
219 |
| - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
220 | 244 |
| |
221 | 245 |
| |
222 | 246 |
| |
| |||
648 | 672 |
| |
649 | 673 |
| |
650 | 674 |
| |
651 |
| - | |
652 |
| - | |
| 675 | + | |
| 676 | + | |
653 | 677 |
| |
654 | 678 |
| |
655 | 679 |
| |
|
Lines changed: 37 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
40 | 77 |
| |
41 | 78 |
| |
42 | 79 |
| |
|
0 commit comments
Comments
(0)