PostgreSQL must provide non-privileged users with error messages that provide information necessary for corrective actions without revealing information that could be exploited by adversaries.

From PostgreSQL 9.x Security Technical Implementation Guide

Part of SRG-APP-000266-DB-000162

Associated with: CCI-001312

SV-87503r1_rule PostgreSQL must provide non-privileged users with error messages that provide information necessary for corrective actions without revealing information that could be exploited by adversaries.

Vulnerability discussion

Any PostgreSQL or associated application providing too much information in error messages on the screen or printout risks compromising the data and security of the system. The structure and content of error messages need to be carefully considered by the organization and development team.Databases can inadvertently provide a wealth of information to an attacker through improperly handled error messages. In addition to sensitive business or personal information, database errors can provide host names, IP addresses, user names, and other system information not required for troubleshooting but very useful to someone targeting the system.Carefully consider the structure/content of error messages. The extent to which information systems are able to identify and handle error conditions is guided by organizational policy and operational requirements. Information that could be exploited by adversaries includes, for example, logon attempts with passwords entered by mistake as the username, mission/business information that can be derived from (if not stated explicitly by) information recorded, and personal information, such as account numbers, social security numbers, and credit card numbers.

Check content

As the database administrator, run the following SQL: SELECT current_setting('client_min_messages'); If client_min_messages is not set to error, this is a finding.

Fix text

As the database administrator, edit postgresql.conf: $ sudo su - postgres $ vi $PGDATA/postgresql.conf Change the client_min_messages parameter to be error: client_min_messages = error Now reload the server with the new configuration (this just reloads settings currently in memory, will not cause an interruption): $ sudo su - postgres # SYSTEMD SERVER ONLY $ systemctl reload postgresql-9.5 # INITD SERVER ONLY $ service postgresql-9.5 reload

Pro Tips

Lavender hyperlinks in small type off to the right (of CSS class id, if you view the page source) point to globally unique URIs for each document and item. Copy the link location and paste anywhere you need to talk unambiguously about these things.

You can obtain data about documents and items in other formats. Simply provide an HTTP header Accept: text/turtle or Accept: application/rdf+xml.

Powered by sagemincer