Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The taint mechanism will be deprecated in Ruby 2.7 #1083

Merged
merged 1 commit into from
Dec 1, 2019

Conversation

kamipo
Copy link
Contributor

@kamipo kamipo commented Nov 21, 2019

The Ruby core team decided to deprecate the taint mechanism in Ruby 2.7
and will remove that in Ruby 3.

https://bugs.ruby-lang.org/issues/16131
ruby/ruby#2476

In Ruby 2.7, Object#{taint,untaint,trust,untrust} and related
functions in the C-API no longer have an effect (all objects are always
considered untainted), and are now warned deprecation message.

The Ruby core team decided to deprecate the taint mechanism in Ruby 2.7
and will remove that in Ruby 3.

https://bugs.ruby-lang.org/issues/16131
ruby/ruby#2476

In Ruby 2.7, `Object#{taint,untaint,trust,untrust}` and related
functions in the C-API no longer have an effect (all objects are always
considered untainted), and are now warned deprecation message.
@sodabrew
Copy link
Collaborator

I'm not sure yet I understand the impact for older Rubies to use the non-taint API calls; it sounds like most code in practice is not using taint hints to protect against untrusted inputs, and so in practice there won't be any impact to "most" real user code?

But I wonder if it wouldn't make sense to wrap these in #ifdef until the older Rubies are no longer supported by this gem.

@kamipo
Copy link
Contributor Author

kamipo commented Nov 27, 2019

IMO if we marked error.message as tainted, I think there is room to carefully consider removing the tainted flag, but error.message is always marked as trusted string, even though it may have an user input.

OTOH error.sql_state is just an error code, it is obviously safe than error.message, but it is not marked as safe (trusted) string unlike error.message.

I believe the inconsistency is not intended.

So I'd say yes for the answer "it sounds like most code in practice is not using taint hints to protect against untrusted inputs, and so in practice there won't be any impact to "most" real user code?".

@sodabrew sodabrew merged commit 785969f into brianmario:master Dec 1, 2019
@kamipo kamipo deleted the remove_deprecated_taint branch December 1, 2019 19:42
snehaso pushed a commit to fac/mysql2 that referenced this pull request Jan 21, 2020
The Ruby core team decided to deprecate the taint mechanism in Ruby 2.7
and will remove that in Ruby 3.

https://bugs.ruby-lang.org/issues/16131
ruby/ruby#2476

In Ruby 2.7, `Object#{taint,untaint,trust,untrust}` and related
functions in the C-API no longer have an effect (all objects are always
considered untainted), and are now warned deprecation message.
snehaso pushed a commit to fac/mysql2 that referenced this pull request Jan 21, 2020
The Ruby core team decided to deprecate the taint mechanism in Ruby 2.7
and will remove that in Ruby 3.

https://bugs.ruby-lang.org/issues/16131
ruby/ruby#2476

In Ruby 2.7, `Object#{taint,untaint,trust,untrust}` and related
functions in the C-API no longer have an effect (all objects are always
considered untainted), and are now warned deprecation message.
snehaso pushed a commit to fac/mysql2 that referenced this pull request Jan 22, 2020
The Ruby core team decided to deprecate the taint mechanism in Ruby 2.7
and will remove that in Ruby 3.

https://bugs.ruby-lang.org/issues/16131
ruby/ruby#2476

In Ruby 2.7, `Object#{taint,untaint,trust,untrust}` and related
functions in the C-API no longer have an effect (all objects are always
considered untainted), and are now warned deprecation message.
snehaso pushed a commit to fac/mysql2 that referenced this pull request Jan 22, 2020
The Ruby core team decided to deprecate the taint mechanism in Ruby 2.7
and will remove that in Ruby 3.

https://bugs.ruby-lang.org/issues/16131
ruby/ruby#2476

In Ruby 2.7, `Object#{taint,untaint,trust,untrust}` and related
functions in the C-API no longer have an effect (all objects are always
considered untainted), and are now warned deprecation message.
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.

2 participants