The vulnerability lies in the use of the jsonpath library, which is susceptible to remote code execution through the evaluation of malicious expressions. The primary attack vector is through Ghost themes, which can use the {{#get}} helper. This helper, in turn, used the vulnerable jsonpath.query function to resolve data paths provided in the theme templates.
The patch replaces the usage of jsonpath.query with a custom, safe implementation called querySimplePath within the get helper's logic. This new function only supports a limited, safe subset of path expressions and does not perform any evaluation, thus eliminating the RCE vulnerability.
A secondary fix was also applied by bumping the @tryghost/api-framework package. This update also removed a dependency on jsonpath within an input validator in the API framework, suggesting a broader effort to remove the vulnerable library from the codebase and hardening against other potential, though less direct, attack vectors.