Bug 1366479
Summary: | CVE-2016-6317 rubygem-activerecord: unsafe query generation in Active Record [fedora-all] | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Martin Prpič <mprpic> |
Component: | rubygem-activerecord | Assignee: | Jun Aruga <jaruga> |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 24 | CC: | jaruga, mmorsi, mtasaka, pvalena, sseago, strzibny, vanmeeuwen+fedora, vondruch |
Target Milestone: | --- | Keywords: | Security, SecurityTracking |
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | rubygem-rails-5.0.0.1-1.fc25 rubygem-rails-5.0.0.1-1.fc26 rubygem-activerecord-5.0.0.1-1.fc25 rubygem-activerecord-4.2.5.2-2.fc24 rubygem-activerecord-4.2.3-3.fc23 | Doc Type: | Release Note |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-08-27 10:26:00 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1365017 | ||
Attachments: |
Description
Martin Prpič
2016-08-12 05:59:55 UTC
Use the following template to for the 'fedpkg update' request to submit an update for this issue as it contains the top-level parent bug(s) as well as this tracking bug. This will ensure that all associated bugs get updated when new packages are pushed to stable. ===== # bugfix, security, enhancement, newpackage (required) type=security # testing, stable request=testing # Bug numbers: 1234,9876 bugs=1365017,1366479 # Description of your update notes=Security fix for CVE-2016-6317 # Enable request automation based on the stable/unstable karma thresholds autokarma=True stable_karma=3 unstable_karma=-3 # Automatically close bugs when this marked as stable close_bugs=True # Suggest that users restart after update suggest_reboot=False ====== Additionally, you may opt to use the bodhi web interface to submit updates: https://bodhi.fedoraproject.org/updates/new I will do it for F24 and F23. Target commit hash is here. https://bugzilla.redhat.com/show_bug.cgi?id=1365017#c6 I found bugs in current F24 latest build for rubygem-activerecord. https://kojipkgs.fedoraproject.org//packages/rubygem-activerecord/4.2.5.2/1.fc24/data/logs/noarch/build.log ``` + ruby -I.:test:lib + egrep '(1|2|3|4|5) failures' sh: sqlite3: command not found sh: sqlite3: command not found 4298 runs, 10894 assertions, 11 failures, 236 errors, 2 skips ~/build/BUILD/activerecord-4.2.5.2 + popd + exit 0 ``` Below line with pipe does not handle the ruby test error. It is success with "11 failures". ``` ruby -I.:test:lib <<EOF | egrep "(1|2|3|4|5) failures" ``` ``` $ ls xyz | echo xyz xyz ls: cannot access xyz: No such file or directory $ echo $? 0 ``` Also sqlite3 is not installed for some reason. rubygem-activerecord depends on rubygem-sqlite3 rubygem-sqlite3 depends on sqlite-devel However I can not find sqlite-devel in PkgDB. Yes, Jun, you are right. the sqlite3 BuildRequire is missing there[1]. Also, the grep is broken, it should be something simmilar to: ``` ruby -I.:test:lib <<EOF | egrep ", (1|2|3|4|5) failures, " ``` to avoid grepping any number which ends with 1-5. > rubygem-sqlite3 depends on sqlite-devel This not relevant, as it is a BuildRequire. [1] http://pkgs.fedoraproject.org/cgit/rpms/rubygem-activerecord.git/tree/rubygem-activerecord.spec?h=f24&id=cc94d5714ddb97aba9b3468ae6f519107cef4277 Thank you for your checking! (In reply to Pavel Valena from comment #5) > Yes, Jun, you are right. the sqlite3 BuildRequire is missing there[1]. > > Also, the grep is broken, it should be something simmilar to: > > ``` > ruby -I.:test:lib <<EOF | egrep ", (1|2|3|4|5) failures, " > ``` > > to avoid grepping any number which ends with 1-5. I want to change the logic to succeed with 1-5 failure like f25, master(rawhide), to comment out unstable unit test. Because we are going to add additional a few unit tests for this ticket's security issue. However above logic can not guarantee the success. > > rubygem-sqlite3 depends on sqlite-devel > This not relevant, as it is a BuildRequire. Sorry, it is not relevant, as you said. > > > [1] > http://pkgs.fedoraproject.org/cgit/rpms/rubygem-activerecord.git/tree/ > rubygem-activerecord.spec?h=f24&id=cc94d5714ddb97aba9b3468ae6f519107cef4277 > I want to change the logic to succeed with 1-5 failure like f25, master(rawhide), to comment out unstable unit test.
Above my English is not correct.
I want to change the test grep logic allowing 1-5 failure,
to comment out unstable unit test with 1-5 failure like f25, master(rawhide).
> > Also, the grep is broken, it should be something simmilar to: > > > > ``` > > ruby -I.:test:lib <<EOF | egrep ", (1|2|3|4|5) failures, " > > ``` > > > > to avoid grepping any number which ends with 1-5. > > I want to change the logic to succeed with 1-5 failure like f25, > master(rawhide), to comment out unstable unit test. > Because we are going to add additional a few unit tests for this ticket's > security issue. However above logic can not guarantee the success. > As a matter of fact, it can. The grep I posted matches exactly 1-5 errors, and therefore, in case of 11 errors it fails. The previous one, in git, however succeeds. That is because the grep did not check for the whole failed tests number, but only for last digit. Therefore it is invalid. If you put there a correct grep expression, like I posted, it will work as expected. The grep is there explicitly for capturing the error code in case of 1 to 5 failures. > I want to change the test grep logic allowing 1-5 failure, > to comment out unstable unit test with 1-5 failure like f25, master(rawhide). AFAIK I do not think it is possible (or practical) to disable the failing tests, as they fail randomly. You would have to disable a great number of them. Rebase to Rails 5.0.0.1 in rawhide and f25 is complete. However I have left buildroot override still active[1], because as of now I cannot 'smoke-test' Rails functionality due to missing rubygem-puma in Fedora. ``` $ rails s . . . Could not find gem 'puma (~> 3.0)' ``` [1] https://bodhi.fedoraproject.org/overrides/?user=pvalena&expired=0 (In reply to Jun Aruga from comment #4) > Also sqlite3 is not installed for some reason. This is the reason: http://pkgs.fedoraproject.org/cgit/rpms/sqlite.git/commit/?h=f24&id=262f80098c106e3739588229694b25e81c1f6723 (In reply to Pavel Valena from comment #5) > Yes, Jun, you are right. the sqlite3 BuildRequire is missing there[1]. Actually, for this cases, when some specific executable is required, I would suggest to use "BR: %{_bindir}/sqlite3". Then it doesn't matter in which package this executable is stored and splits or merges as the one above have zero impact (in ideal world ;) ). (In reply to Pavel Valena from comment #9) > However I have left buildroot override still active[1], because as of now I > cannot 'smoke-test' Rails functionality due to missing rubygem-puma in > Fedora. > > ``` > $ rails s > . . . > Could not find gem 'puma (~> 3.0)' > ``` Just comment out puma. WebRick will be used instead, which is just fine for smoketesting. (In reply to Vít Ondruch from comment #11) > (In reply to Pavel Valena from comment #5) > > Yes, Jun, you are right. the sqlite3 BuildRequire is missing there[1]. > > Actually, for this cases, when some specific executable is required, I would > suggest to use "BR: %{_bindir}/sqlite3". Then it doesn't matter in which > package this executable is stored and splits or merges as the one above have > zero impact (in ideal world ;) ). Yes, that is what I meant. AFAIK there is no sqlite3 package. > Just comment out puma. WebRick will be used instead, which is just fine for smoketesting. Ok, will do that, thanks. rubygem-actioncable-5.0.0.1-1.fc25 rubygem-actionmailer-5.0.0.1-1.fc25 rubygem-actionpack-5.0.0.1-2.fc25 rubygem-actionview-5.0.0.1-2.fc25 rubygem-activejob-5.0.0.1-1.fc25 rubygem-activemodel-5.0.0.1-1.fc25 rubygem-activerecord-5.0.0.1-1.fc25 rubygem-activesupport-5.0.0.1-1.fc25 rubygem-rails-5.0.0.1-1.fc25 rubygem-railties-5.0.0.1-2.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-5760339e76 Created attachment 1191714 [details] f24 - activerecord - Fix for CVE-2016-6317 I fixed for CVE-2016-6317 f24, rubygem-activerecord. Though Later I have to fix rubygem-actionpack too to add its unit test. Created attachment 1191715 [details] f24 - activerecord - Fix for CVE-2016-6317 #2 Sorry updated the patch. rubygem-actioncable-5.0.0.1-1.fc25, rubygem-actionmailer-5.0.0.1-1.fc25, rubygem-actionpack-5.0.0.1-2.fc25, rubygem-actionview-5.0.0.1-2.fc25, rubygem-activejob-5.0.0.1-1.fc25, rubygem-activemodel-5.0.0.1-1.fc25, rubygem-activerecord-5.0.0.1-1.fc25, rubygem-activesupport-5.0.0.1-1.fc25, rubygem-rails-5.0.0.1-1.fc25, rubygem-railties-5.0.0.1-2.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-5760339e76 Created attachment 1191851 [details] f24 - actionpack - Fix for CVE-2016-6317 Hi, I uploaded the patch for CVE-2016-6317 now. This patch is to add a unit test for previous rubygem-activerecord patch. Could you check both patches? Thanks. Created attachment 1191950 [details]
f24 - Tests enhancement
Hi Jun,
I have attached a patch which enhances the separate tests execution you have implemented (please apply it on top of your patch). I have also added some more tests which were failing if not run separately. Please merge the changes into your build.
Otherwise it is fine.
The actionpack patch is also ok.
Created attachment 1192112 [details] f24 - activerecord - Fix for CVE-2016-6317 #3 Pavel, thanks for your patch. Your way is better. I merged your patch with squash. I just modified a little bit more following ruby style used in Rubocop. https://github.com/bbatsov/ruby-style-guide - multi-line method chaining style. - Limit lines to 80 characters I uploaded a patch again. Jun, sure, looks good. I have just forgotten to mention a typo in %changelog: 'compativility' LGTM :) Created attachment 1192143 [details] f24 - activerecord - Fix for CVE-2016-6317 #4 Thanks, I fixed the typo. I uploaded a patch again. Created attachment 1192144 [details] f23 - activerecord - Fix for CVE-2016-6317 I updated a patch for f23 activerecord. f23's ruby version is 2.2.5. We do not need the Ruby 2.3 compatibility patch file for f23. Created attachment 1192151 [details] f23 - actionpack - Fix for CVE-2016-6317 Hi, I uploaded a patch for f23 actionpack. The content is almost same with f24 version. rubygem-activerecord-4.2.5.2-2.fc24 rubygem-actionpack-4.2.5.2-3.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-b4919ffe56 rubygem-activerecord-4.2.3-3.fc23 rubygem-actionpack-4.2.3-6.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-f58d7ecc8a rubygem-actionpack-4.2.3-6.fc23, rubygem-activerecord-4.2.3-3.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-f58d7ecc8a rubygem-actionpack-4.2.5.2-3.fc24, rubygem-activerecord-4.2.5.2-2.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-b4919ffe56 rubygem-actioncable-5.0.0.1-1.fc25, rubygem-actionmailer-5.0.0.1-1.fc25, rubygem-actionpack-5.0.0.1-2.fc25, rubygem-actionview-5.0.0.1-2.fc25, rubygem-activejob-5.0.0.1-1.fc25, rubygem-activemodel-5.0.0.1-1.fc25, rubygem-activerecord-5.0.0.1-1.fc25, rubygem-activesupport-5.0.0.1-1.fc25, rubygem-rails-5.0.0.1-1.fc25, rubygem-railties-5.0.0.1-2.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report. rubygem-actionpack-4.2.5.2-3.fc24, rubygem-activerecord-4.2.5.2-2.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report. rubygem-actionpack-4.2.3-6.fc23, rubygem-activerecord-4.2.3-3.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report. |