sprockets 2.3.0 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of sprockets might be problematic. Click here for more details.
- data/README.md +7 -1
- data/lib/sprockets/asset.rb +1 -0
- data/lib/sprockets/manifest.rb +1 -0
- data/lib/sprockets/server.rb +7 -7
- data/lib/sprockets/version.rb +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -354,7 +354,13 @@ submit a pull request.
|
|
354
354
|
|
355
355
|
## Version History ##
|
356
356
|
|
357
|
-
**2.3.
|
357
|
+
**2.3.1** (February 11, 2012)
|
358
|
+
|
359
|
+
* Added bytesize to manifest
|
360
|
+
* Added Asset#bytesize alias
|
361
|
+
* Security: Check path for forbidden access after unescaping
|
362
|
+
|
363
|
+
**2.3.0** (January 16, 2012)
|
358
364
|
|
359
365
|
* Added special Sass importer that automatically tracks any `@import`ed files.
|
360
366
|
|
data/lib/sprockets/asset.rb
CHANGED
data/lib/sprockets/manifest.rb
CHANGED
data/lib/sprockets/server.rb
CHANGED
@@ -25,11 +25,6 @@ module Sprockets
|
|
25
25
|
|
26
26
|
msg = "Served asset #{env['PATH_INFO']} -"
|
27
27
|
|
28
|
-
# URLs containing a `".."` are rejected for security reasons.
|
29
|
-
if forbidden_request?(env)
|
30
|
-
return forbidden_response
|
31
|
-
end
|
32
|
-
|
33
28
|
# Mark session as "skipped" so no `Set-Cookie` header is set
|
34
29
|
env['rack.session.options'] ||= {}
|
35
30
|
env['rack.session.options'][:defer] = true
|
@@ -38,6 +33,11 @@ module Sprockets
|
|
38
33
|
# Extract the path from everything after the leading slash
|
39
34
|
path = unescape(env['PATH_INFO'].to_s.sub(/^\//, ''))
|
40
35
|
|
36
|
+
# URLs containing a `".."` are rejected for security reasons.
|
37
|
+
if forbidden_request?(path)
|
38
|
+
return forbidden_response
|
39
|
+
end
|
40
|
+
|
41
41
|
# Strip fingerprint
|
42
42
|
if fingerprint = path_fingerprint(path)
|
43
43
|
path = path.sub("-#{fingerprint}", '')
|
@@ -85,12 +85,12 @@ module Sprockets
|
|
85
85
|
end
|
86
86
|
|
87
87
|
private
|
88
|
-
def forbidden_request?(
|
88
|
+
def forbidden_request?(path)
|
89
89
|
# Prevent access to files elsewhere on the file system
|
90
90
|
#
|
91
91
|
# http://example.org/assets/../../../etc/passwd
|
92
92
|
#
|
93
|
-
|
93
|
+
path.include?("..")
|
94
94
|
end
|
95
95
|
|
96
96
|
# Returns a 403 Forbidden response tuple
|
data/lib/sprockets/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sprockets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 2.3.
|
9
|
+
- 1
|
10
|
+
version: 2.3.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sam Stephenson
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2012-
|
19
|
+
date: 2012-02-11 00:00:00 -06:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|