The vulnerability is a cross-site scripting (XSS) issue in the spatie/schema-org library. The root cause is the improper escaping of data when generating JSON-LD script tags. The toScript() method in the BaseType, Graph, and MultiTypedEntity classes uses json_encode to serialize schema data. However, prior to the patch, it did not use the JSON_HEX_TAG flag. This meant that characters like < and > were not escaped. An attacker could provide a malicious string, such as </script><script>alert(1)</script>, as a value for a schema property. When toScript() is called, this string would be rendered directly into the HTML, allowing the attacker to break out of the intended JSON-LD script block and execute arbitrary JavaScript in the context of the user's browser. The provided patch fixes this by adding the JSON_HEX_TAG flag to the json_encode calls, which ensures that < and > are converted to \u003C and \u003E, respectively, thus neutralizing the XSS vector.