Jira (PUP-11848) Ruby 2.7 patched with fix for CVE-2023-28755 breaks parsing of puppet:// URIs for puppet apply

8 views
Skip to first unread message

Manuel Kießling

unread,
May 5, 2023, 5:44:02 AM5/5/23
to puppe...@googlegroups.com
Manuel Kießling created an issue
 
Puppet / Bug PUP-11848
Ruby 2.7 patched with fix for CVE-2023-28755 breaks parsing of puppet:// URIs for puppet apply
Issue Type: Bug Bug
Affects Versions: PUP 5.5.10
Assignee: Unassigned
Components: Language, Networking
Created: 2023/05/05 2:43 AM
Priority: Normal Normal
Reporter: Manuel Kießling

Puppet Version: 5.5.10
Puppet Server Version: N/A
OS Name/Version: Ubuntu 20.04 Focal Fossa

Desired Behavior:

When running puppet apply, file source URIs like puppet:///modules/php7_4/opt/composer/composer should be interpreted as a reference to a local file.

Actual Behavior:

Instead, the URI is interpreted as having a hostname with value "" (empty string), which results in error message Could not evaluate: Could not retrieve file metadata for puppet:///modules/php7_4/opt/composer/composer: Failed to open TCP connection to :8140 (Connection refused - connect(2) for "" port 8140).

I think the culprit is an update of package ruby2.7 on the affected system. See http://changelogs.ubuntu.com/changelogs/pool/main/r/ruby2.7/ruby2.7_2.7.0-5ubuntu1.9/changelog for the changelog entry:

ruby2.7 (2.7.0-5ubuntu1.9) focal-security; urgency=medium  * SECURITY UPDATE: ReDoS
    - debian/patches/CVE-2023-28755-*.patch: URI.parse should set empty
      string in host instead of nil in lib/uri/rfc3986_parser.rb, raise
      ArgumentError with empty host url again in
      lib/net/http/generic_request.rb.
    - CVE-2023-28755
  * SECURITY UPDATE: ReDos
    - debian/patches/CVE-2023-28756-*.patch: fix quadratic backtracking on
      invalid time and make RFC2822 regexp linear in lib/time.rb.
    - CVE-2023-28756
  * debian/patches/fix_test_generic.patch: fix test generic. -- Leonidas Da Silva Barbosa <leo.b...@canonical.com>  Tue, 02 May 2023 05:34:05 -0300{}

 

Sounds like due to this fix, a Puppet URI like puppet:///modules/... }}is suddenly interpreted as protocol=puppet, hostname=, path=/modules/..., although in the context of a {{puppet apply run, it is meant to refer to a local file.

Because the URI parsers now returns the empty string for the hostname (instead of nil), follow-up code thinks it must do a DNS lookup for this hostname - and looking up the empty string of course fails.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo

Manuel Kießling

unread,
May 5, 2023, 5:46:02 AM5/5/23
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
May 5, 2023, 1:30:02 PM5/5/23
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-11848
 
Re: Ruby 2.7 patched with fix for CVE-2023-28755 breaks parsing of puppet:// URIs for puppet apply

Manuel Kießling I don't get the behavior you're describing when using ruby 2.7.8 which includes the fix for CVE-2023-28755:

$ ruby --version
ruby 2.7.8p225 (2023-03-30 revision 1f4d455848) [x86_64-linux]
$ ruby -ruri -e 'puts URI.parse("puppet:///modules/foo").hostname.inspect'
nil

Perhaps there is a problem with Debian's patch?

Manuel Kießling

unread,
May 6, 2023, 3:48:03 AM5/6/23
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages