ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: nobu@ruby-lang.org
To: ruby-core@ruby-lang.org
Subject: [ruby-core:68586] [Ruby trunk - Bug #10988] [PATCH] Raise ArgumentError when string passed to String#crypt contains null
Date: Sat, 21 Mar 2015 06:21:32 +0000	[thread overview]
Message-ID: <redmine.journal-51897.20150321062131.58398cf780eb92c2@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-10988.20150320133542@ruby-lang.org

Issue #10988 has been updated by Nobuyoshi Nakada.


I agree this behavior would be better, but maybe a feature request?

----------------------------------------
Bug #10988: [PATCH] Raise ArgumentError when string passed to String#crypt contains null
https://bugs.ruby-lang.org/issues/10988#change-51897

* Author: Jan Rusnacko
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: 2.3.0dev
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
Currently String#crypt assumes that it is called on a password typed
by the user, specifically, that it does not contain null character.
When it does:

    "abc\0def".crypt("pass") == "abc".crypt("pass")
    => true

This may not be desirable, and developers invoking crypt on strings
that potentially include null may expect different results. To
prevent security failures, this patch changes String#crypt to throw
ArgumentError when invoked on String that includes null character.

https://www.reddit.com/r/netsec/comments/2yugos/null_bytes_bcrypt_problem/

Also PR: https://github.com/ruby/ruby/pull/853

---Files--------------------------------
0001-Raise-ArgumentError-when-string-passed-to-String-cry.patch (1.87 KB)


-- 
https://bugs.ruby-lang.org/

  parent reply	other threads:[~2015-03-21  6:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-10988.20150320133542@ruby-lang.org>
2015-03-20 13:35 ` [ruby-core:68577] [Ruby trunk - Bug #10988] [Open] [PATCH] Raise ArgumentError when string passed to String#crypt contains null jrusnack
2015-03-21  6:21 ` nobu [this message]
2015-06-30  4:19 ` [ruby-core:69805] [Ruby trunk - Bug #10988] " usa
2015-07-02  4:54 ` [ruby-core:69838] " nagachika00

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.journal-51897.20150321062131.58398cf780eb92c2@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).