it finds, either file_get_contents()s the path or curl- * fetches the URL and attaches the result. Without this extension, any * user-controlled string that reaches a markdown mail template can be used * to exfiltrate arbitrary server-readable files or issue arbitrary internal * HTTP requests. See GHSA advisory for the full attack chain. */ class BlockImagesMarkdownExtension implements ExtensionInterface { public function register(EnvironmentBuilderInterface $environment): void { $environment->addRenderer(Image::class, new class implements NodeRendererInterface { public function render(Node $node, ChildNodeRendererInterface $childRenderer): string { return htmlspecialchars( $childRenderer->renderNodes($node->children()), ENT_QUOTES | ENT_HTML5, 'UTF-8' ); } }, 100); } }