Skip to content

Ruby on Rails

2 fixes in rails/rails, maintained by Rails.

Back to all open-source fixes

About Ruby on Rails

Ruby on Rails is a full-stack web framework that powers applications like GitHub, Shopify, and Basecamp. It is made up of components such as Action Dispatch (routing, requests, and parameter handling) and Active Support (core extensions including time zones), and is known for its conventions and long-standing focus on developer productivity.

My work on it

My Rails contributions span Action Dispatch and Active Support. One closes a privacy gap where sensitive values, including Active Record–encrypted attributes, could be written to request logs in clear text; the other makes time-zone offset changes behave as documented during daylight saving time. Both involved reading through how filters and time zones are resolved internally to find where the documented behavior and the actual behavior diverged.

Keeping filtered parameters out of request logs

The problem. Nested parameter filters such as "user.phone_number" were applied to the params hash but not to the logged request path, because the matcher compared the filter against the raw bracketed query key, which could never match. Sensitive values from GET requests appeared in clear text in the “Started GET” log line and instrumentation payloads. This matters most for Active Record encryption, which registers exactly this kind of filter automatically for encrypted attributes.

The fix. Query keys are now converted to dot notation before matching, so bracketed and URL-encoded keys are filtered correctly, while the key written to the log stays unchanged. I deliberately avoided URL-decoding keys, since malformed input would otherwise make building the log line itself fail.

How I tested it. Added a regression test that fails without the change, and confirmed the request, logging, query-string parsing, and redirect test suites all pass.

Returning the requested offset from TimeWithZone#change

The problem. Changing a time’s offset looked up the first time zone whose base offset matched and then applied that zone’s daylight saving rules. Asking for −08:00 in July returned a −07:00 time, a different instant an hour off, even though the method is documented to return exactly the requested offset.

The fix. The lookup now picks a zone whose offset at that specific local time matches the request, skipping ambiguous or nonexistent local times, and keeps the existing fallback when nothing matches.

How I tested it. Added a regression test covering a daylight saving date and a zero offset.