Any popular Rails apps that use to_global_id?
Be Careful with GIDs in Rails
11–20 of 22 posts
Re: Be Careful with GIDs in Rails
#12Re: Be Careful with GIDs in Rails
#13Re: Be Careful with GIDs in Rails
#14Any popular Rails apps that use to_global_id?
Re: Be Careful with GIDs in Rails
#15> GIDs are not checked for authorization when doing the lookup - they are meant to be generated above the authorization layer, and to be consumed above the authorization layer Then the problem with this post boils down to applying the authorization layer in any tool call, just like you do in controllers. Seems obvious?
Re: Be Careful with GIDs in Rails
#16This title is odd, given the actual identified problem seems to be LLMs writing code.
Re: Be Careful with GIDs in Rails
#17If you don't want invoice 22 to be shown by someone putting 22 on the url, you definetly need to enforce permissions on your app. The Global ID issue is tangential to that.
Obviously, this means that first gid was bogus anyway, as it was trying to look up via the wrong key, but the fact that it doesn't fail, and will instead return the record with primary key "22" can certainly be surprising.
Re: Be Careful with GIDs in Rails
#18It's like writing an article about "the dangers of PostgreSQL" ... when generating SQL from an LLM. It has nothing to do with Postgres specifically, it's that you're generating queries to run in a trusted context from an untrustable origin.
Re: Be Careful with GIDs in Rails
#19Rails is a dangerous place to be throwing random data into APIs.