- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit3fe8a6c
committed
Docs: add disclaimer about hazards of using regexps from untrusted sources.
It's not terribly hard to devise regular expressions that take largeamounts of time and/or memory to process. Recent testing by Greg Stark hasalso shown that machines with small stack limits can be driven to stackoverflow by suitably crafted regexps. While we intend to fix these thingsas much as possible, it's probably impossible to eliminate slow-executioncases altogether. In any case we don't want to treat such things assecurity issues. The history of that code should already discourageprudent DBAs from allowing execution of regexp patterns coming frompossibly-hostile sources, but it seems like a good idea to warn about thehazard explicitly.Currently, similar_escape() allows access to enough of the underlyingregexp behavior that the warning has to apply to SIMILAR TO as well.We might be able to make it safer if we tightened things up to allow onlySQL-mandated capabilities in SIMILAR TO; but that would be a subtlynon-backwards-compatible change, so it requires discussion and probablycould not be back-patched.Per discussion among pgsql-security list.1 parenta1c4afa commit3fe8a6c
1 file changed
+22
-0
lines changedLines changed: 22 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3074 | 3074 |
| |
3075 | 3075 |
| |
3076 | 3076 |
| |
| 3077 | + | |
| 3078 | + | |
| 3079 | + | |
| 3080 | + | |
| 3081 | + | |
| 3082 | + | |
| 3083 | + | |
| 3084 | + | |
| 3085 | + | |
| 3086 | + | |
| 3087 | + | |
| 3088 | + | |
| 3089 | + | |
| 3090 | + | |
| 3091 | + | |
| 3092 | + | |
| 3093 | + | |
| 3094 | + | |
| 3095 | + | |
| 3096 | + | |
| 3097 | + | |
| 3098 | + | |
3077 | 3099 |
| |
3078 | 3100 |
| |
3079 | 3101 |
| |
|
0 commit comments
Comments
(0)