← PHP / Laravel · Contents

PHP-076 / Intermediate

Logging the entire request (Input::all), including passwords

A09:2021 Security Logging and Monitoring Failures · CWE-532 Sensitive Info in Log

Why is this a problem?

People with access to log collection systems can see passwords.

How to fix it

php
Log::debug('request', $request->except(['password', 'password_confirmation', 'token']));

Further reading