Skip to content

Commit a5497b2

Browse files
authored
Merge pull request #1050 from puppetlabs/cve_release
5.2.1 mergeback
2 parents 1c1d935 + 4dbd3d4 commit a5497b2

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
44
and this project adheres to [Semantic Versioning](http://semver.org).
55

6+
## Supported Release [5.2.1]
7+
### Summary
8+
This release fixes CVE-2018-6508 which is a potential arbitrary code execution via tasks.
9+
10+
### Fixed
11+
- Fix export and mysql tasks for arbitrary remote code
12+
613
## Supported Release [5.2.0]
714

815
### Added

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "puppetlabs-mysql",
3-
"version": "5.2.0",
3+
"version": "5.2.1",
44
"author": "Puppet Labs",
55
"summary": "Installs, configures, and manages the MySQL service.",
66
"license": "Apache-2.0",

tasks/sql.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
require 'puppet'
55

66
def get(sql, database, user, password)
7-
cmd_string = "mysql -e \"#{sql}\""
8-
cmd_string << " --database=#{database}" unless database.nil?
9-
cmd_string << " --user=#{user}" unless user.nil?
10-
cmd_string << " --password=#{password}" unless password.nil?
11-
stdout, _stderr, status = Open3.capture3(cmd_string)
7+
cmd = ['mysql', '-e', "#{sql} "]
8+
cmd << "--database=#{database}" unless database.nil?
9+
cmd << "--user=#{user}" unless user.nil?
10+
cmd << "--password=#{password}" unless password.nil?
11+
stdout, stderr, status = Open3.capture3(*cmd) # rubocop:disable Lint/UselessAssignment
1212
raise Puppet::Error, _("stderr: ' %{stderr}') % { stderr: stderr }") if status != 0
1313
{ status: stdout.strip }
1414
end

0 commit comments

Comments
 (0)