{"record":{"id":"d037f19b48b58389","repo":"getgrav/grav","slug":"svg-file-xss-check-failed-on-s","errorCode":null,"errorMessage":"SVG file XSS check failed on %s","messagePattern":"SVG file XSS check failed on (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"system/src/Grav/Framework/Form/FormFlashFile.php","lineNumber":198,"sourceCode":"     * @return array\n     */\n    #[\\ReturnTypeWillChange]\n    public function jsonSerialize()\n    {\n        return $this->upload;\n    }\n\n    /**\n     * @return void\n     */\n    public function checkXss(): void\n    {\n        $tmpFile = $this->getTmpFile();\n        $mime = $this->getClientMediaType();\n        if (Utils::contains($mime, 'svg', false)) {\n            $response = Security::detectXssFromSvgFile($tmpFile);\n            if ($response) {\n                throw new RuntimeException(sprintf('SVG file XSS check failed on %s', $response));\n            }\n        }\n    }\n\n    /**\n     * @return string|null\n     */\n    public function getTmpFile(): ?string\n    {\n        $tmpName = $this->upload['tmp_name'] ?? null;\n\n        if (!$tmpName) {\n            return null;\n        }\n\n        $tmpFile = $this->flash->getTmpDir() . '/' . $tmpName;\n\n        return file_exists($tmpFile) ? $tmpFile : null;","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/getgrav/grav/blob/6040efed04efa69b8209448ed81308e7c24147c2/system/src/Grav/Framework/Form/FormFlashFile.php#L180-L216","documentation":"Error \"SVG file XSS check failed on %s\" thrown in getgrav/grav.","triggerScenarios":"Thrown at system/src/Grav/Framework/Form/FormFlashFile.php:198 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6040efed04efa69b8209448ed81308e7c24147c2","analyzedAt":"2026-08-17T05:07:31.593Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}