22-Year-Old PostgreSQL Bug Turned into Remote Code Execution
2026 “, ?” , .
, . 22- .
.
3 “ ”. , 1 2 .
, , . . . _, . , . , . , .
2026
, . _. , .
. _ . , ? . .
, . , :
? ?
, .
: _ + 23.
101
. 1337?
, .
, , 1337 . . , .
. 23 ? [ 57 5 0 0 0 0 0 0 ] 1337 ? , 5 . , _ :
4 [ 57 5 0 0 0 0 0 0 ] , :
, :
1337 . 8 [ 57 5 0 0 0 0 0 0 ] 4 ?
32. , 8 1337::4 .
8- , , ?
_ . .
1337 “ .”. = 23.
( ) _
_ . , . ?
, = -1 . = .
8- . . , !
!
, . . .
/ :
. “ .” _ , . 705, !
, !
, 4. 4 4() 4()
PostgreSQL converts the unknown literal ‘1337’ through int4in() into a Datum, then returns text through int4out(). : !
, . _ .
, . . .
4() 4. .
, , / .
“ ?”
, . .
’ 4 . .
:
. .
4 . !
, !
. . 2 .
, .
, .
:
. , ?
, , ( ) .
.
2005, .
, , .
, . .
, :
“ ; .”–
, . , . ' 1=1 -- , .
. , . . , .
!
22-
; , , . ? 4, , .
. , . _ :
, , ?
. , . , , . [1, 2]
, . .
. , , .
!
!
.
. ( )
, , , . .
, !
: ?
. , . .
.
. ,
, . 24 024 >> 2 9. 4- + 5- = 9 !
, , 01 . , .
.
.
, 01 02. , 01 02 . .
, . , .
, _., , , _().
_() _. ‘ ’ ()
() . !
byteaout() interprets 01 02 as an external expanded-object header and the following eight zero bytes as a NULL object pointer. , 12 !
00000000 , .
() , . .
_, .
___(). :
00000000 , . _ .
: !
.
. . , , .
. . .
, .
, , .
A forged expanded object redirects PostgreSQL’s methods lookup, turning the normal detoasting path into a call to system(H). ($)
.
, _ +008.
, (). , , .
, (), () .
, _ . > +008.
1, /// . .
_ . ,
“ _ . ?”– _
. .
. () .
, :
, () .
, ?
, () ! , .
, ’ () ! !
48 . 16 . 3 48 !
Three UUID fields provide 48 controlled bytes: 24 for array metadata, 4 for the text header, 16 for the payload, and 4 filler bytes. 48- . . , []!
() , . +4 .
. .
-2026-6460 21
, . .
, .
21 .
9 2026 52 .
6 52 .
- -2026-6460 . ,
- -2026-120142 .
- -2026-120148
- -2026-116329
- -2026-116306 []
- -2026-120139
5 , .
, ?
.
! .
. .
0. !
. .
1 . .
/ .
. .
.
:
20 . , . . .
“ ( )” . , , @ .
. , , . . .
, .
, 90 , 30 .
. !://.//-8-2026-11-30
( , ! .)
:
0774013, 5, 2004 ... ... .
159077, 14, 2015, . 20+ .
-2026-6460 “ .” . , , .
. 2026.
:
: <.@.>: <@.>: <@11...>: <@.>: <89@.>: <@.>: <@.>: : <@.>: @ <@.>: <.@.>: <@.>: <@.>: <.@.>: <@.>: <@.>: <@.>: <@.>