Leakage of sensitive information in exception message

Description

Returning detailed error messages to users could reveal sensitive information. This could lead to

Remediations

❌ Don't configure your application to return details for every error:

config.consider_all_requests_local = false

❌ Don't use show_detailed_exceptions? in controllers:

class MyController < ApplicationController
def show_detailed_exceptions?
...
end
end

Associated CWE

OWASP Top 10

Configuration

To skip this rule during a scan, use the following flag

bearer scan /path/to/your-project/ --skip-rule=ruby_rails_detailed_exceptions

To run only this rule during a scan, use the following flag

bearer scan /path/to/your-project/ --only-rule=ruby_rails_detailed_exceptions