pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Eyedia Tech <eyedia@debjyoti.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: chkpass Major Issue - compares 'contains' and not 'equal'
Date: Thu, 07 Jun 2018 10:14:54 -0400
Message-ID: <18834.1528380894@sss.pgh.pa.us> (raw)
In-Reply-To: <CAHcjpqfBK=YZZjJPLfS=E8C1ZK_RJyqyZW=8uxn4D1-XtmSS5A@mail.gmail.com>
References: <CAHcjpqfBK=YZZjJPLfS=E8C1ZK_RJyqyZW=8uxn4D1-XtmSS5A@mail.gmail.com>

Eyedia Tech <eyedia@debjyoti.com> writes:
> To replicate use this:
> create table "user" (uname text, password chkpass);
> insert into "user" values ('user1', 'password')
> select * from "user" where uname = 'user1' and password = 'password1'

That would depend on the behavior of your local version of crypt(3),
but historically, that library function uses only the first eight
characters of the password, which explains this example.

> This is a major issue.

We're not going to treat it as such.  It's clearly documented, see

https://www.postgresql.org/docs/current/static/chkpass.html

FWIW, chkpass is deprecated and has been removed entirely as of PG 11.
It has a lot of design problems above and beyond its reliance on a
40-year-old encryption spec.

			regards, tom lane




view thread (4+ messages)  latest in thread

Message-ID: <18834.1528380894@sss.pgh.pa.us>
Permalink:  ../18834.1528380894@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/18834.1528380894@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, eyedia@debjyoti.com
  Subject: Re: chkpass Major Issue - compares 'contains' and not 'equal'
  In-Reply-To: <18834.1528380894@sss.pgh.pa.us>
  References: <CAHcjpqfBK=YZZjJPLfS=E8C1ZK_RJyqyZW=8uxn4D1-XtmSS5A@mail.gmail.com> <18834.1528380894@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox