Commit Graph

43183 Commits

Author SHA1 Message Date
Rafael Mendonça França 0cad778c26
Merge branch '4-1-16' into 4-1-stable 2016-07-12 23:48:24 -03:00
Rafael Mendonça França d880330405
Preparing for 4.1.16 release 2016-07-12 19:18:54 -03:00
Rafael Mendonça França 871d63e2c7
Preparing for 4.1.16.rc1 release 2016-07-01 23:13:18 -03:00
Rafael Mendonça França be6c5d950d
Change the generator assertion to use mocks 2016-07-01 21:25:45 -03:00
Rafael Mendonça França 647f212296
Do not run `bundle install` when generating a new plugin.
Since bundler 1.12.0, the gemspec is validated so the `bundle install`
command will fail just after the gem is created causing confusion to the
users. This change was a bug fix to correctly validate gemspecs.
2016-07-01 17:34:31 -03:00
Rafael Mendonça França 9f5cbe613c
Make explicit the version of mime-types with work with 1.9 2016-06-30 23:14:40 -03:00
Arun Agrawal c1361ed948
skip-git should not hit git commands plugin generators 2016-06-30 23:12:38 -03:00
Abd ar-Rahman Hamidi 7bf10f5c8f
Automaticly add username and email if configured in git-scm, as bundle gem 2016-06-30 22:49:13 -03:00
Rafael Mendonça França 6bfcc34b0a
Make sure we use mime-types 2 to avoid build error with ruby 1.9 2016-06-30 22:42:07 -03:00
Rafael Mendonça França ee03a406c0
Sign the tag when releasing 2016-06-30 21:52:18 -03:00
Arthur Nogueira Neves 41b4d81b4f Merge pull request #24098 from kamipo/fix_typo_sslcipher-4-1
Backport to 4-1-stable "Fix typo `--ssl-cipher`"
2016-03-07 20:01:01 -05:00
Ryuta Kamizono 5b5f7ace41 Fix typo `--ssl-cipher`
Backport #24082 for #23293.
2016-03-08 08:23:54 +09:00
Rafael Mendonça França abd4ac712c Merge branch '4-1-15' into 4-1-stable 2016-03-07 19:40:15 -03:00
Rafael Mendonça França d5c4b82b64 Preparing for 4.1.15 release 2016-03-07 19:34:57 -03:00
Rafael Mendonça França c9ad290f0b Merge pull request #23293 from drcapulet/alexc-backport-20126-4-1-stable
Add full set of MySQL CLI options to support SSL authentication when using db:structure dump and load
2016-03-07 19:12:36 -03:00
Rafael Mendonça França 786951d44a Update the rendering guide to match the current behavior
In the latest security releases render with a trailing slash no more call
render :file.

Also add a note about the security implications of using it with user
parameters.
2016-03-05 20:10:08 -03:00
Rafael Mendonça França 06d2bfd42a Preparing for 4.1.15.rc1 release 2016-03-01 15:41:59 -03:00
Arthur Neves 03c9957dfe Fix version on changelog
cc @rafaelfranca
[skip ci]
2016-02-29 15:16:26 -05:00
Rafael Mendonça França c0166075df Merge branch '4-1-14' into 4-1-stable 2016-02-29 16:57:17 -03:00
Rafael Mendonça França 4cffd33a96 Preparing for 4.1.14.2 release 2016-02-29 16:01:59 -03:00
Jon Moss 983d9e0bda Fix ActionView tests
Reverts some of the changes from #23242.
2016-02-29 15:59:48 -03:00
Jon Moss 7647138ecb Add outside_app_allowed arg to find_templates
A backport of #23247 to 4-1-stable.
2016-02-29 15:59:44 -03:00
Rafael Mendonça França c43e368947 Bundle update 2016-02-29 15:59:38 -03:00
Aaron Patterson 387eea05f8 fix permitted? conditional for `render` calls 2016-02-29 15:58:26 -03:00
Aaron Patterson 5ed694e0ce Merge pull request #23242 from maclover7/fix-error-sec
Fix undefined error for `ActionController::Parameters`
2016-02-29 15:58:21 -03:00
Arthur Neves fcf0f42494 Don't allow render(params) on views.
If `render(params)` is called in a view it should be protected the same
 way it is in the controllers. We should raise an error if thats happens.

Fix CVE-2016-2098.
2016-02-29 15:57:53 -03:00
Aaron Patterson 8a1d3ea617 Change render "foo" to render a template and not a file.
Previously, calling `render "foo/bar"` in a controller action is
equivalent to `render file: "foo/bar"`. This has been changed to
mean `render template: "foo/bar"` instead. If you need to render a
file, please change your code to use the explicit form
(`render file: "foo/bar"`) instead.

Test that we are not allowing you to grab a file with an absolute path
outside of your application directory. This is dangerous because it
could be used to retrieve files from the server like `/etc/passwd`.

Fix CVE-2016-2097.
2016-02-29 15:57:47 -03:00
Rafael Mendonça França f4d8158969 Use Ruby 1.9 Hash syntax 2016-02-12 19:13:56 -02:00
Aaron Patterson 331210df7c Generated engines should protect from forgery
Generated engines should call `protect_from_forgery`.  If this method
isn't called, then the Engine could be susceptible to XSS attacks.
Thanks @tomekr for reporting this to us!

Conflicts:
	railties/lib/rails/generators/rails/plugin/templates/app/controllers/%namespaced_name%/application_controller.rb.tt
	railties/test/generators/plugin_generator_test.rb
2016-02-01 17:44:18 -08:00
Rafael França c7d2f4caed Merge pull request #23328 from RickCSong/rickcsong/fix-predicate-builder
Fix custom primary keys when calling `Relation#where`
2016-01-29 00:50:15 -05:00
Rick Song 849dec458e Makes a minor fix to PredicateBuilder respect custom primary keys when
calling `Relation#where`
2016-01-28 20:41:41 -08:00
Jon Moss 00545f3221 Fix ActionView tests
Reverts some of the changes from #23242.
2016-01-28 21:25:27 -05:00
Jon Moss fb7b36e655 Add outside_app_allowed arg to find_templates
A backport of #23247 to 4-1-stable.
2016-01-28 21:25:01 -05:00
Rafael Mendonça França 1db1f82670 Bundle update 2016-01-28 21:24:52 -05:00
eileencodes 722aa32fa5 Run `file.close` before unlinking for travis
This works on OSX but for some reason travis is throwing a
```
  1) Error:
ExpiresInRenderTest#test_dynamic_render_with_absolute_path:
NoMethodError: undefined method `unlink' for nil:NilClass
```
Looking at other tests in Railties the file has a name and we close
it before unlinking, so I'm going to try that.
2016-01-28 15:52:42 -05:00
eileencodes 5f2195af48 Regression test for rendering file from absolute path
Test that we are not allowing you to grab a file with an absolute path
outside of your application directory. This is dangerous because it
could be used to retrieve files from the server like `/etc/passwd`.
2016-01-28 14:18:40 -05:00
Godfrey Chan 8cbf301b4a Fix actionpack test cases broken by #16888 2016-01-28 14:14:14 -05:00
Godfrey Chan f5f7eccc4f Revert "Revert "Merge pull request #16888 from jejacks0n/render_template""
This reverts commit 585e75696b.

Conflicts:
	actionview/CHANGELOG.md
	guides/source/4_2_release_notes.md
2016-01-28 14:12:50 -05:00
Aaron Patterson 683d4f7675 clear view path cache between tests
The cache for `render file:` seems to also be used in the case of
`render(string)`.  If one is supposed to be a hit and the other is
supposed to be a miss, and they both reference the same file, then the
cache could return incorrect values.  This commit clears the cache
between runs so that we get non-cached behavior.
2016-01-28 10:52:29 -08:00
Alex Coomans 9eb1eddaae Add full set of MySQL CLI options to support SSL authentication when using db:structure dump and load 2016-01-27 13:06:20 -08:00
Rafael França 98a01c6f01 Merge pull request #23288 from bdewater/sprockets3-sha2-alt
Fix img alt attribute generation when using Sprockets >= 3.0
2016-01-27 14:18:32 -05:00
Aaron Patterson e8eda76893 fix permitted? conditional for `render` calls 2016-01-26 18:00:35 -08:00
Aaron Patterson 56034c1538 Merge pull request #23242 from maclover7/fix-error-sec
Fix undefined error for `ActionController::Parameters`
2016-01-26 17:25:26 -08:00
Aaron Patterson 7921ff8c21 Merge branch '4-1-sec' into 4-1-stable
* 4-1-sec:
  bumping version
  Remove unnecessary caching
  Eliminate instance level writers for class accessors
  allow :file to be outside rails root, but anything else must be inside the rails view directory
  Don't short-circuit reject_if proc
  stop caching mime types globally
  use secure string comparisons for basic auth username / password
2016-01-25 11:24:03 -08:00
Aaron Patterson 31ab3aa0e8 bumping version 2016-01-25 10:26:09 -08:00
eileencodes 98629dfcce Remove unnecessary caching
`ActiveSupport::Dependencies.constantize(const_name)` calls
`Reference.new` which is defined as
`ActiveSupport::Dependencies.constantize(const_name)` meaning this call
is already cached and we're doing caching that isn't necessary.

Conflicts:
	actionpack/lib/action_dispatch/routing/route_set.rb

Conflicts:
	actionpack/lib/action_dispatch/routing/route_set.rb

CVE-2015-7581
2016-01-22 15:03:27 -08:00
Aaron Patterson 50d3d7d011 Eliminate instance level writers for class accessors
Instance level writers can have an impact on how the Active Model /
Record objects are saved.  Specifically, they can be used to bypass
validations.  This is a problem if mass assignment protection is
disabled and specific attributes are passed to the constructor.

Conflicts:
	activerecord/lib/active_record/scoping/default.rb
	activesupport/lib/active_support/callbacks.rb

CVE-2016-0753
2016-01-22 15:03:03 -08:00
Aaron Patterson be543e8e18 allow :file to be outside rails root, but anything else must be inside the rails view directory
Conflicts:
	actionpack/test/controller/render_test.rb
	actionview/lib/action_view/template/resolver.rb

CVE-2016-0752
2016-01-22 15:02:03 -08:00
Andrew White 5875bc3ade Don't short-circuit reject_if proc
When updating an associated record via nested attribute hashes the
reject_if proc could be bypassed if the _destroy flag was set in the
attribute hash and allow_destroy was set to false.

The fix is to only short-circuit if the _destroy flag is set and the
option allow_destroy is set to true. It also fixes an issue where
a new record wasn't created if _destroy was set and the option
allow_destroy was set to false.

CVE-2015-7577
2016-01-22 15:01:10 -08:00
Aaron Patterson 221937c8ba stop caching mime types globally
Unknown mime types should not be cached globally.  This global cache
leads to a memory leak and a denial of service vulnerability.

CVE-2016-0751
2016-01-22 15:00:00 -08:00