{"record":{"id":"8886971e063929dc","repo":"Leantime/leantime","slug":"refused-to-fetch-ical-feed-url-failed-ssrf-safety","errorCode":null,"errorMessage":"Refused to fetch iCal feed: URL failed SSRF safety check","messagePattern":"Refused to fetch iCal feed: URL failed SSRF safety check","errorType":"exception","errorClass":"\\Exception","httpStatus":null,"severity":"error","filePath":"app/Domain/Calendar/Services/Calendar.php","lineNumber":866,"sourceCode":"\n    /**\n     * Load an iCal URL and return its contents.\n     *\n     * Validates the URL against SSRF attacks before making the request.\n     *\n     * @param  string  $url  The URL of the iCal feed.\n     * @return string The iCal content.\n     *\n     * @throws \\Exception If the URL is unsafe or there is an error loading the URL.\n     */\n    public function loadIcalUrl(string $url): string\n    {\n        if (str_contains($url, 'webcal://')) {\n            $url = str_replace('webcal://', 'https://', $url);\n        }\n\n        if (! OutboundUrlGuard::isAllowedUrl($url)) {\n            throw new \\Exception('Refused to fetch iCal feed: URL failed SSRF safety check');\n        }\n\n        $client = new \\GuzzleHttp\\Client;\n\n        try {\n            $response = $client->get($url, [\n                'allow_redirects' => OutboundUrlGuard::redirectOptions(),\n                'headers' => [\n                    'Accept' => 'text/calendar',\n                    'User-Agent' => 'Leantime Calendar Integration v'.$this->config->appVersion,\n                ],\n            ]);\n\n            if ($response->getStatusCode() == 200) {\n                return (string) $response->getBody();\n            }\n\n            throw new \\Exception('Failed to load iCal feed: HTTP '.$response->getStatusCode());","sourceCodeStart":848,"sourceCodeEnd":884,"githubUrl":"https://github.com/Leantime/leantime/blob/9a9f49f1008f4782b30f6723c54228f4f992e636/app/Domain/Calendar/Services/Calendar.php#L848-L884","documentation":"Error \"Refused to fetch iCal feed: URL failed SSRF safety check\" thrown in Leantime/leantime.","triggerScenarios":"Thrown at app/Domain/Calendar/Services/Calendar.php:866 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":"9a9f49f1008f4782b30f6723c54228f4f992e636","analyzedAt":"2026-08-21T02:37:38.966Z","schemaVersion":2},"datasetVersion":"2026-08-21T03:17:12.404Z"}