• last updated 21 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Stronger password hashes for OpenACS

This change introduces the possibility to use either the classical

OpenACS password hash algorithm "salted-sha1" or the SCRAM passord

function "scram-sha-256". The latter can be used by (a) using the

most recent version of NaviServer (from Sept 28, 2021 or newer) and

(b) by configuring the password hash preferences via Kernel package

parameter "PasswordHashAlgorithm". The package parameter can contain a

list of multiple hash algorithms in preference order. The most

preferred available algorithm is chosen.

By default, the "PasswordHashAlgorithm" is "salted-sha1", and the

behavior is as before. After upgrading to the new version of acs-tcl

and acs-kernel, the preference list can be configured. When a user

logs in and the preferred available algorithm is different from the

previously used algorithm, the upgrade is performed for the user

automatically.

The usage of SHA1 in OpenACS is easily target of security audits (see

[1]). The biggest danger is that if somebody gets full access to the

"users" table (e.g. when decommissioning a hard disk). In this case

the hashes can be attacked with dictionaries by using some crypto

hardware (when someone gets raw access to the DB, one has usually some

other big problems). However, by using the "scram-sha-256" hash

function this danger is substantially reduced. This function computes

a password hash using PBKDF2 (Password-Based Key Derivation Function

2). This function is used to reduce vulnerabilities of brute-force

attacks against password hashes. The hash function of SCRAM is PBKDF2

[RFC2898] with HMAC as the pseudorandom function (PRF) and with dkLen

== output length of HMAC == output length of the digest function. So,

it uses a better hash algorithm (sha-256 vs. sha1) and applies this a

high number of times (15K times for a password hash computation).

NaviServer supports as well the even better SCRYPT algorithm, but this

is only available when NaviServer is compiled with OpenSSL 3.0 or

newer. On the contrary, scram-sha-256 (actually PKCS5_PBKDF2_HMAC) is

available since OpenSSL 1.0.0 (2015).

All the improved hash functions require NaviServer with its tight

integration to the crypto functions of OpenSSL.

[1] https://openacs.org/forums/message-view?message_id=5522562

  1. … 6 more files in changeset.
Whitespace cleanup

  1. … 2 more files in changeset.
Reduce divergency between oracke and postgres codebase

  1. … 2 more files in changeset.
- improve spacing

Merged 4.6.4d1 (unreleased) to HEAD. This marks the end of the life of the oacs-4-6 branch.

  1. … 816 more files in changeset.
Update the password_changed_date whenever the user's password is changed

  1. … 3 more files in changeset.
merge of 4.6.3b1 to HEAD

  1. … 107 more files in changeset.
rewrite the sessions_sweep query so it will use an index on last_hit

  1. … 1 more file in changeset.

Merged with OpenACS 4.5 beta1 branch.

  1. … 88 more files in changeset.
Applied Michael Cleverly's patch #187 which updates last_hit in sec_session_properties,

which causes the dead-tuple sweeping code to work.

Fixed this stuff so it works with Oracle and Postgres both, sharing as much

code as possible (or at least as I can make possible).

  1. … 3 more files in changeset.

Forgot to commit the query files earlier and there were a couple of typos

in the Oracle/clob code, too.

  1. … 2 more files in changeset.

Fixed the 4K character limit on session properties for Oracle by making an

optional "clob" value available. The APM wouldn't let me load any packages

when I added all the dotLRN packages plus standard packages over to a new

"dotlrn" user from my normal "acs" user - the list of packages grew to

> 4KB in size! Grrrr!

  1. … 6 more files in changeset.

Renamed a column named "timestamp" in the security package because this is

now a reserved word in PG (correctly). I changed the Oracle version, too,

because I know that 9i has added the "timestamp" datatype and even if it

will accept it as a column name it's confusing.

I also changes postgresql.sql to load correctly under PG 7.1 and 7.2.

  1. … 8 more files in changeset.
query extractor output for acs-tcl

    • -0
    • +72
    ./security-procs.xql
  1. … 41 more files in changeset.