Skip to content

Restrict subscription timestamp deserialization - #5691

Open
ydah wants to merge 1 commit into
rmosolgo:masterfrom
ydah:restrict-subscription-timestamp-classes
Open

Restrict subscription timestamp deserialization#5691
ydah wants to merge 1 commit into
rmosolgo:masterfrom
ydah:restrict-subscription-timestamp-classes

Conversation

@ydah

@ydah ydah commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

This PR prevents arbitrary constant resolution during subscription payload deserialization.

Previously, timestamp payloads used Object.const_get to resolve the class name and then called strptime on it. If an untrusted payload reached this code path, it could invoke methods on an arbitrary top-level class.

Timestamp deserialization is now restricted to Date, DateTime, Time, and ActiveSupport::TimeWithZone when available. Unsupported classes raise ArgumentError.

A regression test verifies that strptime is not invoked on arbitrary classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant