Compare commits

...

65 Commits

Author SHA1 Message Date
Parker Moore
5bffa83d67 Release 1.5.1 2014-03-28 02:27:22 -04:00
Parker Moore
1ef08f8eba Merge pull request #2179 from jekyll/release-1-5-1
Release 1.5.1
2014-03-28 02:27:02 -04:00
Parker Moore
504688f3a4 DEM RELEASE NOTES (1.5.1) THO 2014-03-27 23:06:04 -04:00
Parker Moore
cda905adb0 Update dat gemspec yo. 2014-03-27 23:05:23 -04:00
Parker Moore
bdb5567a37 such release 🐶 :doge: 1.5.1 2014-03-27 23:05:14 -04:00
Parker Moore
4547511f42 Update history to reflect merge of #2176 [ci skip] 2014-03-27 22:42:50 -04:00
Parker Moore
49cb4338b3 Merge pull request #2176 from jekyll/security-v1-stable 2014-03-27 22:42:30 -04:00
Parker Moore
36fed4f629 Only strip the drive name if it begins the string. 2014-03-27 18:25:58 -04:00
Parker Moore
d75dbf7010 Release 1.5.0 2014-03-24 21:08:41 -04:00
Parker Moore
8b6f2092ee Merge pull request #2168 from jekyll/release-1-5-0
Release v1.5.0
2014-03-24 21:08:23 -04:00
Parker Moore
e4829c5ade Hehe. [ci skip] 2014-03-24 21:01:13 -04:00
Parker Moore
a71d5348ee Update gem spec. 2014-03-24 20:56:53 -04:00
Parker Moore
87c8d5750d Add dat blog post. 2014-03-24 20:56:42 -04:00
Parker Moore
215d00de90 Get things ready for 1.5.0 2014-03-24 20:56:37 -04:00
Parker Moore
07601e4baf Update history to reflect merge of #2167 [ci skip] 2014-03-24 20:35:36 -04:00
Parker Moore
d4be74c5d8 Merge pull request #2167 from jekyll/v1-fix-windows
V1 Fix Windows Filesystem Issue
2014-03-24 20:30:16 -04:00
Parker Moore
02ca48b558 Create and use Jekyll.sanitized_path 2014-03-24 20:17:26 -04:00
Parker Moore
74eaccf94a Be looser about safe_yaml requirement 2014-03-24 20:15:26 -04:00
Parker Moore
7c9f7e3ae6 Lock to Cucumber 1.3.11 2014-03-24 20:15:18 -04:00
Parker Moore
ac6faaf681 Lock to Maruku 0.7.0 2014-03-24 20:15:11 -04:00
Parker Moore
ddc64d077b Cucumber should always run Jekyll using --trace 2014-03-24 20:15:00 -04:00
Parker Moore
1c20af4ce8 Update history to reflect merge of #1942 [ci skip] 2014-01-21 23:42:33 -05:00
Parker Moore
a7cec73ae5 Merge pull request #1942 from jekyll/v1-stable-safe-yaml-update 2014-01-21 20:14:57 -08:00
Parker Moore
2f98460681 Merge pull request #1943 from jekyll/v1-stable-readme-update 2014-01-14 08:43:38 -08:00
Matt Rogers
9a5dd7144c Update the README to reflect the repo move 2014-01-14 07:39:55 -06:00
Parker Moore
0e20ced151 Release 1.4.3 2014-01-13 18:10:33 -08:00
Parker Moore
13742c7503 Merge pull request #1945 from jekyll/release-1.4.3
Release 1.4.3
2014-01-13 18:08:31 -08:00
Parker Moore
73beb3986a Require Liquid 2.5.5 2014-01-13 18:07:25 -08:00
Parker Moore
a5e0403d1d Update history 2014-01-13 18:06:02 -08:00
Parker Moore
6eccb11d88 I may as well identify myself here 2014-01-13 17:49:28 -08:00
Parker Moore
fbc2c7e56e Update History & gemspec with version release info. 2014-01-13 17:48:30 -08:00
Parker Moore
4df2b9346a Add 1.4.3 release post by @BenBalter. 2014-01-13 17:47:15 -08:00
Parker Moore
53259039a4 Update history to reflect merge of #1944 2014-01-13 17:42:49 -08:00
Parker Moore
71bb0289e5 Merge pull request #1944 from jekyll/vuln-patch 2014-01-13 17:42:19 -08:00
Parker Moore
780c9302f4 Patch File.realpath for Ruby 1.8.7 2014-01-13 17:35:05 -08:00
Andy Lindeman
b55fb3d816 Prevents disclosure of file existence
Signed-off-by: Parker Moore <parkrmoore@gmail.com>
2014-01-13 17:22:08 -08:00
Ben Balter
3901c88805 sanity check for pages permalink traversal
Signed-off-by: Parker Moore <parkrmoore@gmail.com>
2014-01-13 17:22:08 -08:00
Ben Balter
10d1f49902 escape relative post permalinks, cleanup
Signed-off-by: Parker Moore <parkrmoore@gmail.com>
2014-01-13 17:22:08 -08:00
Ben Balter
98b366e5d5 patch symlink vuln and properly test
Signed-off-by: Parker Moore <parkrmoore@gmail.com>
2014-01-13 17:22:08 -08:00
Ben Balter
b1a7e145c0 test symlinkd dir, not file
Signed-off-by: Parker Moore <parkrmoore@gmail.com>
2014-01-13 17:22:08 -08:00
Ben Balter
6277335ba0 rebreak tests, move sanitization closer to write
Signed-off-by: Parker Moore <parkrmoore@gmail.com>
2014-01-13 17:22:08 -08:00
Ben Balter
e7cf42b624 fix symlink so tests fail
Signed-off-by: Parker Moore <parkrmoore@gmail.com>
2014-01-13 17:22:08 -08:00
Ben Balter
69b439904b unbreak tests
Signed-off-by: Parker Moore <parkrmoore@gmail.com>
2014-01-13 17:22:08 -08:00
Ben Balter
033971053e add symlink failing test
Signed-off-by: Parker Moore <parkrmoore@gmail.com>
2014-01-13 17:22:08 -08:00
Ben Balter
93a6d4d9c0 test multiple traversals
Signed-off-by: Parker Moore <parkrmoore@gmail.com>
2014-01-13 17:22:08 -08:00
Ben Balter
827eed78b9 fix failing post count test
Signed-off-by: Parker Moore <parkrmoore@gmail.com>
2014-01-13 17:22:08 -08:00
Ben Balter
a06dff4eca url escape before sanitizing
Signed-off-by: Parker Moore <parkrmoore@gmail.com>
2014-01-13 17:22:08 -08:00
Ben Balter
823f875836 failing test
Signed-off-by: Parker Moore <parkrmoore@gmail.com>
2014-01-13 17:22:07 -08:00
Matt Rogers
f5f3c51c2b Bump safe_yaml to ~> 1.0.0
Be more strict about what versions we'll take, since this is the stable
branch
2014-01-13 16:44:45 -06:00
Parker Moore
4af594916f Add link to 'a regression' in 1.4.2 release post 2013-12-16 20:29:27 -05:00
Parker Moore
92da39eb6f Release 1.4.2 2013-12-16 20:18:33 -05:00
Parker Moore
f8983194c8 Update history to reflect release of v1.4.2 2013-12-16 20:16:00 -05:00
Parker Moore
b716cc62fe Bump to v1.4.2 2013-12-16 20:14:42 -05:00
Parker Moore
24495c6355 Rakefile's site:releases:new should use 'release' variable instead of 'version' function to specify version in YAML front-matter 2013-12-16 20:14:33 -05:00
Parker Moore
8d6c09cc4f Add 1.4.2 release post 2013-12-16 20:13:55 -05:00
Matt Rogers
9cc1a8f178 Update history to reflect merge of #1830 2013-12-16 08:01:39 -06:00
Matt Rogers
0d6b208380 Merge pull request #1830 from jekyll/support-maruku-fenced-code-blocks
Support Maruku fenced code blocks
2013-12-16 06:01:32 -08:00
Parker Moore
3fdc91eb78 Add two tests for Maruku fenced code blocks 2013-12-15 15:10:17 -05:00
Parker Moore
6b0c511b9d Support Maruku fenced code blocks
In Maruku v0.7.0, they default to off. Need to default them on our end to on.
2013-12-15 14:54:13 -05:00
Matt Rogers
aa5c98d281 Release 1.4.1 2013-12-09 20:56:36 -06:00
Matt Rogers
eb54b7f90d Allow releases from the v1-stable branch 2013-12-09 20:56:22 -06:00
Matt Rogers
e92b67dfb9 Bump the gemspec version to 1.4.1 2013-12-09 20:55:56 -06:00
Matt Rogers
3a870fd09e Prep for a 1.4.1 release 2013-12-09 20:36:19 -06:00
Matt Rogers
3607ac5e5f Update history to reflect merge of #1796 2013-12-09 20:25:15 -06:00
Parker Moore
ca95e75976 Reject nil entries in Site#read_things 2013-12-09 20:25:04 -06:00
30 changed files with 355 additions and 40 deletions

View File

@@ -10,6 +10,44 @@
### Site Enhancements
## 1.5.1 / 2014-03-27
### Bug Fixes
* Only strip the drive name if it begins the string (#2176)
## 1.5.0 / 2014-03-24
### Minor Enhancements
* Loosen `safe_yaml` dependency to `~> 1.0` (#2167)
* Bump `safe_yaml` dependency to `~> 1.0.0` (#1942)
### Bug Fixes
* Fix issue where filesystem traversal restriction broke Windows (#2167)
* Lock `maruku` at `0.7.0` (#2167)
### Development Fixes
* Lock `cucmber` at `1.3.11` (#2167)
## 1.4.3 / 2014-01-13
### Bug Fixes
* Patch show-stopping security vulnerabilities (#1944)
## 1.4.2 / 2013-12-16
### Bug Fixes
* Turn on Maruku fenced code blocks by default (#1830)
## 1.4.1 / 2013-12-09
### Bug Fixes
* Don't allow nil entries when loading posts (#1796)
## 1.4.0 / 2013-12-07
### Major Enhancements

View File

@@ -2,10 +2,10 @@
[![Gem Version](https://badge.fury.io/rb/jekyll.png)](http://badge.fury.io/rb/jekyll)
[![Build Status](https://secure.travis-ci.org/mojombo/jekyll.png?branch=master)](https://travis-ci.org/mojombo/jekyll)
[![Code Climate](https://codeclimate.com/github/mojombo/jekyll.png)](https://codeclimate.com/github/mojombo/jekyll)
[![Dependency Status](https://gemnasium.com/mojombo/jekyll.png)](https://gemnasium.com/mojombo/jekyll)
[![Coverage Status](https://coveralls.io/repos/mojombo/jekyll/badge.png)](https://coveralls.io/r/mojombo/jekyll)
[![Build Status](https://secure.travis-ci.org/jekyll/jekyll.png?branch=master)](https://travis-ci.org/jekyll/jekyll)
[![Code Climate](https://codeclimate.com/github/jekyll/jekyll.png)](https://codeclimate.com/github/jekyll/jekyll)
[![Dependency Status](https://gemnasium.com/jekyll/jekyll.png)](https://gemnasium.com/jekyll/jekyll)
[![Coverage Status](https://coveralls.io/repos/jekyll/jekyll/badge.png)](https://coveralls.io/r/jekyll/jekyll)
By Tom Preston-Werner, Nick Quaranto, and many awesome contributors!
@@ -15,7 +15,7 @@ Jekyll is a simple, blog aware, static site generator. It takes a template direc
* [Install](http://jekyllrb.com/docs/installation/) the gem
* Read up about its [Usage](http://jekyllrb.com/docs/usage/) and [Configuration](http://jekyllrb.com/docs/configuration/)
* Take a gander at some existing [Sites](http://wiki.github.com/mojombo/jekyll/sites)
* Take a gander at some existing [Sites](http://wiki.github.com/jekyll/jekyll/sites)
* Fork and [Contribute](http://jekyllrb.com/docs/contributing/) your own modifications
* Have questions? Check out `#jekyll` on irc.freenode.net.
@@ -53,4 +53,4 @@ Jekyll is a simple, blog aware, static site generator. It takes a template direc
## License
See [LICENSE](https://github.com/mojombo/jekyll/blob/master/LICENSE).
See [LICENSE](https://github.com/jekyll/jekyll/blob/master/LICENSE).

View File

@@ -233,7 +233,7 @@ namespace :site do
post.puts("title: 'Jekyll #{release} Released'")
post.puts("date: #{Time.new.strftime('%Y-%m-%d %H:%M:%S %z')}")
post.puts("author: ")
post.puts("version: #{version}")
post.puts("version: #{release}")
post.puts("categories: [release]")
post.puts("---")
post.puts
@@ -252,8 +252,8 @@ end
#############################################################################
task :release => :build do
unless `git branch` =~ /^\* master$/
puts "You must be on the master branch to release!"
unless `git branch` =~ /^(\* master|\* v1-stable)$/
puts "You must be on the master branch or the v1-stable branch to release!"
exit!
end
sh "git commit --allow-empty -m 'Release #{version}'"

View File

@@ -28,3 +28,40 @@ Feature: Markdown
And I should see "Index" in "_site/index.html"
And I should see "<h1 id=\"my_title\">My Title</h1>" in "_site/index.html"
Scenario: Maruku fenced codeblocks
Given I have a configuration file with "markdown" set to "maruku"
And I have an "index.markdown" file with content:
"""
---
title: My title
---
# My title
```
My awesome code
```
"""
When I run jekyll
Then the _site directory should exist
And I should see "My awesome code" in "_site/index.html"
And I should see "<pre><code>\nMy awesome code\n</code></pre>" in "_site/index.html"
Scenario: Maruku fenced codeblocks
Given I have a configuration file with "markdown" set to "maruku"
And I have an "index.markdown" file with content:
"""
---
title: My title
---
# My title
```ruby
puts "My awesome string"
```
"""
When I run jekyll
Then the _site directory should exist
And I should see "My awesome string" in "_site/index.html"
And I should see "<pre class="ruby"><code class="ruby">\nputs &quot;My awesome string&quot;\n</code></pre>" in "_site/index.html"

View File

@@ -13,7 +13,7 @@ JEKYLL_PATH = File.join(File.dirname(__FILE__), '..', '..', 'bin', 'jekyll')
def run_jekyll(opts = {})
command = JEKYLL_PATH.clone
command << " build"
command << " build --trace"
command << " --drafts" if opts[:drafts]
command << " >> /dev/null 2>&1" if opts[:debug].nil?
system command
@@ -21,7 +21,7 @@ end
def call_jekyll_new(opts = {})
command = JEKYLL_PATH.clone
command << " new"
command << " new --trace"
command << " #{opts[:path]}" if opts[:path]
command << " --blank" if opts[:blank]
command << " >> /dev/null 2>&1" if opts[:debug].nil?

View File

@@ -4,9 +4,9 @@ Gem::Specification.new do |s|
s.rubygems_version = '1.3.5'
s.name = 'jekyll'
s.version = '1.4.0'
s.version = '1.5.1'
s.license = 'MIT'
s.date = '2013-12-07'
s.date = '2014-03-27'
s.rubyforge_project = 'jekyll'
s.summary = "A simple, blog aware, static site generator."
@@ -23,13 +23,13 @@ Gem::Specification.new do |s|
s.rdoc_options = ["--charset=UTF-8"]
s.extra_rdoc_files = %w[README.markdown LICENSE]
s.add_runtime_dependency('liquid', "~> 2.5.2")
s.add_runtime_dependency('liquid', "~> 2.5.5")
s.add_runtime_dependency('classifier', "~> 1.3")
s.add_runtime_dependency('listen', "~> 1.3")
s.add_runtime_dependency('maruku', "~> 0.7.0")
s.add_runtime_dependency('maruku', "0.7.0")
s.add_runtime_dependency('pygments.rb', "~> 0.5.0")
s.add_runtime_dependency('commander', "~> 4.1.3")
s.add_runtime_dependency('safe_yaml', "~> 0.9.7")
s.add_runtime_dependency('safe_yaml', "~> 1.0")
s.add_runtime_dependency('colorator', "~> 0.1")
s.add_runtime_dependency('redcarpet', "~> 2.3.0")
s.add_runtime_dependency('toml', '~> 0.1.0')
@@ -39,7 +39,7 @@ Gem::Specification.new do |s|
s.add_development_dependency('redgreen', "~> 1.2")
s.add_development_dependency('shoulda', "~> 3.3.2")
s.add_development_dependency('rr', "~> 1.1")
s.add_development_dependency('cucumber', "~> 1.3")
s.add_development_dependency('cucumber', "1.3.11")
s.add_development_dependency('RedCloth', "~> 4.2")
s.add_development_dependency('kramdown', "~> 1.2")
s.add_development_dependency('rdiscount', "~> 1.6")
@@ -160,6 +160,10 @@ Gem::Specification.new do |s|
site/_posts/2013-11-04-jekyll-1-3-0-released.markdown
site/_posts/2013-11-26-jekyll-1-3-1-released.markdown
site/_posts/2013-12-07-jekyll-1-4-0-released.markdown
site/_posts/2013-12-16-jekyll-1-4-2-released.markdown
site/_posts/2014-01-13-jekyll-1-4-3-released.markdown
site/_posts/2014-03-24-jekyll-1-5-0-released.markdown
site/_posts/2014-03-27-jekyll-1-5-1-released.markdown
site/css/gridism.css
site/css/normalize.css
site/css/pygments.css
@@ -219,6 +223,7 @@ Gem::Specification.new do |s|
test/source/_data/products.yml
test/source/_includes/params.html
test/source/_includes/sig.markdown
test/source/_includes/tmp
test/source/_layouts/default.html
test/source/_layouts/post/simple.html
test/source/_layouts/simple.html
@@ -256,6 +261,7 @@ Gem::Specification.new do |s|
test/source/_posts/2013-05-10-number-category.textile
test/source/_posts/2013-07-22-post-excerpt-with-layout.markdown
test/source/_posts/2013-08-01-mkdn-extension.mkdn
test/source/_posts/2014-01-06-permalink-traversal.md
test/source/_posts/es/2008-11-21-nested.textile
test/source/about.html
test/source/category/_posts/2008-9-23-categories.textile
@@ -264,6 +270,7 @@ Gem::Specification.new do |s|
test/source/contacts/index.html
test/source/css/screen.css
test/source/deal.with.dots.html
test/source/exploit.md
test/source/foo/_posts/bar/2008-12-12-topical-post.textile
test/source/index.html
test/source/products.yml
@@ -286,6 +293,7 @@ Gem::Specification.new do |s|
test/test_new_command.rb
test/test_page.rb
test/test_pager.rb
test/test_path_sanitization.rb
test/test_post.rb
test/test_rdiscount.rb
test/test_redcarpet.rb

View File

@@ -63,7 +63,7 @@ require_all 'jekyll/tags'
SafeYAML::OPTIONS[:suppress_warnings] = true
module Jekyll
VERSION = '1.4.0'
VERSION = '1.5.1'
# Public: Generate a Jekyll configuration Hash by merging the default
# options with anything in _config.yml, and adding the given options on top.
@@ -97,4 +97,17 @@ module Jekyll
def self.logger
@logger ||= Stevenson.new
end
# Get a subpath without any of the traversal nonsense.
#
# Returns a pure and clean path
def self.sanitized_path(base_directory, questionable_path)
clean_path = File.expand_path(questionable_path, "/")
clean_path.gsub!(/\A\w\:\//, '/')
unless clean_path.start_with?(base_directory)
File.join(base_directory, clean_path)
else
clean_path
end
end
end

View File

@@ -45,6 +45,7 @@ module Jekyll
'excerpt_separator' => "\n\n",
'maruku' => {
'fenced_code_blocks' => true,
'use_tex' => false,
'use_divs' => false,
'png_engine' => 'blahtex',

View File

@@ -8,6 +8,7 @@ module Jekyll
@errors = []
load_divs_library if @config['maruku']['use_divs']
load_blahtext_library if @config['maruku']['use_tex']
enable_fenced_code_blocks if @config['maruku']['fenced_code_blocks']
rescue LoadError
STDERR.puts 'You are missing a library required for Markdown. Please run:'
STDERR.puts ' $ [sudo] gem install maruku'
@@ -35,6 +36,10 @@ module Jekyll
MaRuKu::Globals[:html_png_url] = @config['maruku']['png_url']
end
def enable_fenced_code_blocks
MaRuKu::Globals[:fenced_code_blocks] = true
end
def print_errors_and_fail
print @errors.join
raise MaRuKu::Exception, "MaRuKu encountered problem(s) while converting your markup."

View File

@@ -78,6 +78,10 @@ class File
def self.read_with_options(path, opts = {})
self.read(path)
end
def self.realpath(filename)
Pathname.new(filename).realpath.to_s
end
else
def self.read_with_options(path, opts = {})
self.read(path, opts)

View File

@@ -133,8 +133,8 @@ module Jekyll
#
# Returns the destination file path String.
def destination(dest)
path = File.join(dest, self.url)
path = File.join(path, "index.html") if self.url =~ /\/$/
path = Jekyll.sanitized_path(dest, url)
path = File.join(path, "index.html") if url =~ /\/$/
path
end

View File

@@ -86,7 +86,7 @@ module Jekyll
# Get the full path to the directory containing the post files
def containing_dir(source, dir)
return File.join(source, dir, '_posts')
File.join(source, dir, '_posts')
end
# Read the YAML frontmatter.
@@ -266,7 +266,7 @@ module Jekyll
# Returns destination file path String.
def destination(dest)
# The url needs to be unescaped in order to preserve the correct filename
path = File.join(dest, CGI.unescape(self.url))
path = Jekyll.sanitized_path(dest, CGI.unescape(url))
path = File.join(path, "index.html") if path[/\.html$/].nil?
path
end

View File

@@ -193,8 +193,10 @@ module Jekyll
end
def read_things(dir, magic_dir, klass)
things = get_entries(dir, magic_dir).map do |entry|
get_entries(dir, magic_dir).map do |entry|
klass.new(self, self.source, dir, entry) if klass.valid?(entry)
end.reject do |entry|
entry.nil?
end
end

View File

@@ -87,14 +87,13 @@ eos
end
def render(context)
dir = File.join(context.registers[:site].source, INCLUDES_DIR)
validate_dir(dir, context.registers[:site].safe)
dir = File.join(File.realpath(context.registers[:site].source), INCLUDES_DIR)
file = retrieve_variable(context) || @file
validate_file_name(file)
path = File.join(dir, file)
validate_file(path, context.registers[:site].safe)
validate_path(path, dir, context.registers[:site].safe)
begin
partial = Liquid::Template.parse(source(path, context))
@@ -108,18 +107,16 @@ eos
end
end
def validate_dir(dir, safe)
if File.symlink?(dir) && safe
raise IOError.new "Includes directory '#{dir}' cannot be a symlink"
def validate_path(path, dir, safe)
if safe && !realpath_prefixed_with?(path, dir)
raise IOError.new "The included file '#{path}' should exist and should not be a symlink"
elsif !File.exist?(path)
raise IOError.new "Included file '#{path}' not found"
end
end
def validate_file(file, safe)
if !File.exists?(file)
raise IOError.new "Included file '#{@file}' not found in '#{INCLUDES_DIR}' directory"
elsif File.symlink?(file) && safe
raise IOError.new "The included file '#{INCLUDES_DIR}/#{@file}' should not be a symlink"
end
def realpath_prefixed_with?(path, dir)
File.exist?(path) && File.realpath(path).start_with?(dir)
end
def blank?

View File

@@ -50,6 +50,7 @@ module Jekyll
# Returns a sanitized String URL
def sanitize_url(in_url)
# Remove all double slashes
url = in_url.gsub(/\/\//, "/")
@@ -61,6 +62,7 @@ module Jekyll
# Always add a leading slash
url.gsub!(/\A([^\/])/, '/\1')
url
end
end

View File

@@ -9,10 +9,10 @@ categories: [release]
Coming just 10 days after the release of v1.1.0, v1.1.1 is out with a patch for the nasty
excerpt inception bug ([#1339][]) and non-zero exit codes for invalid commands
([#1338][]).
excerpt inception bug ([1339][]) and non-zero exit codes for invalid commands
([1338][]).
To all those affected by the [strange excerpt bug in v1.1.0][#1321], I'm sorry. I think we
To all those affected by the [strange excerpt bug in v1.1.0][1321], I'm sorry. I think we
have it all patched up and it should be deployed to [GitHub Pages][gh_pages] in the next
couple weeks. Thank you for your patience!

View File

@@ -0,0 +1,18 @@
---
layout: news_item
title: 'Jekyll 1.4.2 Released'
date: 2013-12-16 19:48:13 -0500
author: parkr
version: 1.4.2
categories: [release]
---
This release fixes [a regression][] where Maruku fenced code blocks were turned
off, instead of the previous default to on. We've added a new default
configuration to our `maruku` config key: `fenced_code_blocks` and set it to
default to `true`.
If you do not wish to use Maruku fenced code blocks, you may turn this option
off in your site's configuration file.
[a regression]: https://github.com/jekyll/jekyll/pull/1830

View File

@@ -0,0 +1,27 @@
---
layout: news_item
title: 'Jekyll 1.4.3 Released'
date: 2014-01-13 17:43:32 -0800
author: benbalter
version: 1.4.3
categories: [release]
---
Jekyll 1.4.3 contains two **critical** security fixes. If you run Jekyll locally
and do not run Jekyll in "safe" mode (e.g. you do not build Jekyll sites on behalf
of others), you are not affected and are not required to update at this time.
([See pull request.]({{ site.repository }}/pull/1944))
Versions of Jekyll prior to 1.4.3 and greater than 1.2.0 may allow malicious
users to expose the content of files outside the source directory in the
generated output via improper symlink sanitization, potentially resulting in an
inadvertent information disclosure.
Versions of Jekyll prior to 1.4.3 may also allow malicious users to write
arbitrary `.html` files outside of the destination folder via relative path
traversal, potentially overwriting otherwise-trusted content with arbitrary HTML
or Javascript depending on your server's configuration.
*Maintainer's note: Many thanks to @gregose and @charliesome for discovering
these vulnerabilities, and to @BenBalter and @alindeman for writing the patch.
-@parkr*

View File

@@ -0,0 +1,19 @@
---
layout: news_item
title: 'Jekyll 1.5.0 Released'
date: 2014-03-24 20:37:59 -0400
author: parkr
version: 1.5.0
categories: [release]
---
As work continues on Jekyll 2.0.0, we felt it was important to address two key
issues of Jekyll 1.4.3, namely the `safe_yaml` dependency below 1.0 and the
inability to use Jekyll 1.4.3 on Windows due to a [fun issue with path sanitizing][].
For a full changelog, check out our [history][] page.
Now, back to work on 2.0.0!
[fun issue with path sanitizing]: https://github.com/jekyll/jekyll/issues/1948
[history]: /docs/history/#150__20140324

View File

@@ -0,0 +1,26 @@
---
layout: news_item
title: 'Jekyll 1.5.1 Released'
date: 2014-03-27 22:43:48 -0400
author: parkr
version: 1.5.1
categories: [release]
---
The hawk-eyed [@gregose](https://github.com/gregose) spotted a bug in our
`Jekyll.sanitized_path` code:
{% highlight ruby %}
> sanitized_path("/tmp/foobar/jail", "..c:/..c:/..c:/etc/passwd")
=> "/tmp/foobar/jail/../../../etc/passwd"
{% endhighlight %}
Well, we can't have that! In 1.5.1, you'll instead see:
{% highlight ruby %}
> sanitized_path("/tmp/foobar/jail", "..c:/..c:/..c:/etc/passwd")
=> "/tmp/foobar/jail/etc/passwd"
{% endhighlight %}
Luckily not affecting 1.4.x, this fix will make 1.5.0 that much safer for
the masses. Thanks, Greg!

View File

@@ -316,6 +316,7 @@ maruku:
png_engine: blahtex
png_dir: images/latex
png_url: /images/latex
fenced_code_blocks: true
rdiscount:
extensions: []

View File

@@ -1,10 +1,42 @@
---
layout: docs
title: History
permalink: /docs/history/
permalink: "/docs/history/"
prev_section: contributing
---
## 1.5.0 / 2014-03-24
### Minor Enhancements
- Loosen `safe_yaml` dependency to `~> 1.0` ([#2167]({{ site.repository }}/issues/2167))
- Bump `safe_yaml` dependency to `~> 1.0.0` ([#1942]({{ site.repository }}/issues/1942))
### Bug Fixes
- Fix issue where filesystem traversal restriction broke Windows ([#2167]({{ site.repository }}/issues/2167))
- Lock `maruku` at `0.7.0` ([#2167]({{ site.repository }}/issues/2167))
### Development Fixes
- Lock `cucmber` at `1.3.11` ([#2167]({{ site.repository }}/issues/2167))
## 1.4.3 / 2014-01-13
### Bug Fixes
- Patch show-stopping security vulnerabilities ([#1944]({{ site.repository }}/issues/1944))
## 1.4.2 / 2013-12-16
### Bug Fixes
- Turn on Maruku fenced code blocks by default ([#1830]({{ site.repository }}/issues/1830))
## 1.4.1 / 2013-12-09
### Bug Fixes
- Don't allow nil entries when loading posts ([#1796]({{ site.repository }}/issues/1796))
## 1.4.0 / 2013-12-07
### Major Enhancements

1
test/source/_includes/tmp Symbolic link
View File

@@ -0,0 +1 @@
/tmp

View File

@@ -0,0 +1,5 @@
---
permalink: /%2e%2e/%2e%2e/%2e%2e/baddie.html
---
# Test

5
test/source/exploit.md Normal file
View File

@@ -0,0 +1,5 @@
---
permalink: /%2e%2e/%2e%2e/%2e%2e/baddie.html
---
# Test

View File

@@ -14,7 +14,7 @@ class TestGeneratedSite < Test::Unit::TestCase
end
should "ensure post count is as expected" do
assert_equal 36, @site.posts.size
assert_equal 37, @site.posts.size
end
should "insert site.posts into the index" do

View File

@@ -101,6 +101,16 @@ class TestPage < Test::Unit::TestCase
assert_equal @page.permalink, @page.url
assert_equal "/about/", @page.dir
end
should "not be writable outside of destination" do
unexpected = File.expand_path("../../../baddie.html", dest_dir)
File.delete unexpected if File.exist?(unexpected)
page = setup_page("exploit.md")
do_render(page)
page.write(dest_dir)
assert !File.exist?(unexpected)
end
end
context "with specified layout of nil" do

View File

@@ -0,0 +1,18 @@
require 'helper'
class TestPathSanitization < Test::Unit::TestCase
context "on Windows with absolute source" do
setup do
@source = "C:/Users/xmr/Desktop/mpc-hc.org"
@dest = "./_site/"
stub(Dir).pwd { "C:/Users/xmr/Desktop/mpc-hc.org" }
end
should "strip drive name from path" do
assert_equal "C:/Users/xmr/Desktop/mpc-hc.org/_site", Jekyll.sanitized_path(@source, @dest)
end
should "strip just the initial drive name" do
assert_equal "/tmp/foobar/jail/..c:/..c:/..c:/etc/passwd", Jekyll.sanitized_path("/tmp/foobar/jail", "..c:/..c:/..c:/etc/passwd")
end
end
end

View File

@@ -75,6 +75,17 @@ class TestPost < Test::Unit::TestCase
assert_equal "/my_category/permalinked-post", @post.url
end
should "not be writable outside of destination" do
unexpected = File.expand_path("../../../baddie.html", dest_dir)
File.delete unexpected if File.exist?(unexpected)
post = setup_post("2014-01-06-permalink-traversal.md")
do_render(post)
post.write(dest_dir)
assert !File.exist?(unexpected)
assert File.exist?(File.expand_path("baddie.html", dest_dir))
end
context "with CRLF linebreaks" do
setup do
@real_file = "2009-05-24-yaml-linebreak.markdown"

View File

@@ -347,6 +347,41 @@ CONTENT
end
context "include tag with parameters" do
context "with symlink'd include" do
should "not allow symlink includes" do
File.open("/tmp/pages-test", 'w') { |file| file.write("SYMLINK TEST") }
assert_raise IOError do
content = <<CONTENT
---
title: Include symlink
---
{% include tmp/pages-test %}
CONTENT
create_post(content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true, 'safe' => true })
end
assert_no_match /SYMLINK TEST/, @result
end
should "not expose the existence of symlinked files" do
ex = assert_raise IOError do
content = <<CONTENT
---
title: Include symlink
---
{% include tmp/pages-test-does-not-exist %}
CONTENT
create_post(content, {'permalink' => 'pretty', 'source' => source_dir, 'destination' => dest_dir, 'read_posts' => true, 'safe' => true })
end
assert_match /should exist and should not be a symlink/, ex.message
end
end
context "with one parameter" do
setup do
content = <<CONTENT