|
|
|
@@ -22,7 +22,7 @@ try { |
|
|
|
|
|
|
|
$png = [Convert]::FromBase64String('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+jRZkAAAAASUVORK5CYII=') |
|
|
|
[System.IO.File]::WriteAllBytes($imagePath, $png) |
|
|
|
$safe = '<html><body><h1 style="color:#112233; font-size:20px">Postcard</h1><p>See our offer.</p><img src="images/logo.png" width="1" height="1" alt="Logo" /><a href="https://example.invalid">Details</a></body></html>' |
|
|
|
$safe = '<html><body><h1 style="color:#112233; font-size:20px">Postcard</h1><p>See our offer.</p><img src="images/logo.png" width="1" height="1" alt="Logo" /><a href="http://example.invalid">Details</a></body></html>' |
|
|
|
[System.IO.File]::WriteAllText($templatePath, $safe, [System.Text.Encoding]::UTF8) |
|
|
|
|
|
|
|
& $powerShellX86 -NoProfile -ExecutionPolicy Bypass -File (Join-Path $PSScriptRoot 'import-template.ps1') -Path $templatePath -ConfigPath $configPath |
|
|
|
@@ -40,7 +40,8 @@ try { |
|
|
|
foreach ($invalid in @( |
|
|
|
$safe.Replace('<p>See our offer.</p>', '<script>alert(1)</script>'), |
|
|
|
$safe.Replace('images/logo.png', '../secret.png'), |
|
|
|
$safe.Replace('color:#112233', 'background-image:url(file:///C:/secret)') |
|
|
|
$safe.Replace('color:#112233', 'background-image:url(file:///C:/secret)'), |
|
|
|
$safe.Replace('http://example.invalid', 'javascript:alert(1)') |
|
|
|
)) { |
|
|
|
[System.IO.File]::WriteAllText($templatePath, $invalid, [System.Text.Encoding]::UTF8) |
|
|
|
$ErrorActionPreference = 'Continue' |
|
|
|
|