You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3f1ab53
Browse filesBrowse the repository at this point in the historyBrowse files
Leave the input a params parser quotes out of error lines
When Rails can't parse a request's params, the parser's message quotes the input
where it stopped: JSON's "unexpected character: '<body>'", Rack's "invalid
%-encoding (<value>)". The error line copied it into cause_message, and Rails'
BadRequest wraps it in its own message ("Invalid request parameters: ..."), so a
password there was logged unfiltered, at any log level.
Error lines for Rails' ParseError (and its ParamErrors), Rack's params errors and
errors raised because of them keep the error and cause classes and Rails' words
before the input, without the parser's message.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,6 +88,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
88
-**Security**: LogStruct no longer empties Rails' `filter_parameters` or loads ActiveRecord and the other frameworks before the app's initializers run, so `filter_attributes` and Rails' own parameter filtering keep working (GHSA-cpp6-p4hf-383g)
89
89
-**Security**: Values nested deeper than the depth limit are summarized instead of logged raw, skipping filtering and scrubbing (#15)
90
90
-**Security**: When Rails can't parse a request's body (malformed JSON), its debug line gives the body's size and type. Rails logged the whole body there, so a password in it was logged unfiltered
91
+
-**Security**: The error line for params Rails can't parse (malformed JSON, a bad %-encoding) leaves out the input the parser's message quotes: it has no `cause_message`, and Rails' "Invalid request parameters: ..." stops before the input. A password where the parser stopped was logged unfiltered
91
92
-**Security**: Structs, `ActionController::Parameters` and other objects in a log line are filtered and scrubbed like Hashes, instead of being serialized unfiltered
92
93
-**Fix**: A value that refers back to itself (a Hash or Array containing its own parent) is logged once instead of being expanded up to the depth limit, which took seconds and produced very large lines
93
94
-**ActiveRecord**: Verbose query logs (the "↳ caller" lines) are turned off as intended. The integration set them on `ActiveRecord::Base`, which loaded it early and never matched, because the setting is on the `ActiveRecord` module
0 commit comments