Re: update phenomenom - Mailing list pgsql-general

From Jan Wieck
Subject Re: update phenomenom
Date
Msg-id 3EE0EBDC.9040404@Yahoo.com
Whole thread Raw
In response to update phenomenom  ("Henrik Steffen" <steffen@city-map.de>)
List pgsql-general
Henrik Steffen wrote:
> Hello all,
>
> I have a table consisting of about 450.000 rows
> with a unique primary key char(9)
>
> kundennummer CHAR(9) unique primary key
> ... some fields...
> miano CHAR(6)
>
> Today someone issued an
>
> UPDATE table SET miano='071002' WHERE kundennummer='071002883';
>
> and managed to UPDATE all the 450.000 rows, updating
> the miano to the value '071002' by issuing this command.
>
>
> The update is generated through a web-based intranet-solution,
> unfortunately I didn't have a postgresql-logfile for this, but
> I can see from the webserver logfile, which scripts was run
> at the particular time.
>
> For me it's almost 99.9 % sure, that it's no error in the
> perl-program. There is only one command issuing exactly
>
> SQL("UPDATE $table SET $daten WHERE kundennummer='$kundennummer';");

You expect that $daten contains precisely

     miano='071002'

I guess the 071002 is coming from an input field in a form, no? What if
someone managed to get

     miano='071002';'

into $daten by entering 071002'; into the field?


Jan

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #


pgsql-general by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: Select from multiple tables
Next
From: "Jim C. Nasby"
Date:
Subject: Re: Bug in metaphone (contrib/fuzzystrmatch)