Skip to content

[Bug]: Initialize-MonkeyHtml: HTML report broken due to jsDelivr 301 redirect not followed #178

@tranbert

Description

@tranbert

What happened?
Since a recent change on jsDelivr's side, the HTML report is generated broken. Only the "About Author" section is visible — no data, no CSS, no JS. The error message is:
Initialize-MonkeyHtml : Moved Permanently. Redirecting to /gh/silverhack/monkey365assets@latest/assets/config.json
How to reproduce it

Run Invoke-Monkey365 -IncludeEntraID -ExportTo HTML -OutDir C:\output
HTML report is generated but completely broken (no styling, no data)

Expected behavior
A fully rendered HTML report with charts, findings and styling.
Screenshots or Logs
The root cause is in Initialize-MonkeyHtml.ps1 — the Invoke-WebRequest call in the cdn block does not specify -MaximumRedirection, so PowerShell 5 blocks on the 301 returned by jsDelivr and never gets the actual content.
Fix — add -MaximumRedirection 5 to both Invoke-WebRequest calls in Initialize-MonkeyHtml.ps1:
powershell$content = Invoke-WebRequest -Uri $baseUrl -UseBasicParsing -MaximumRedirection 5
From where are you running Monkey365?

Resource: workstation
OS: Windows
PowerShell Version: 5.1
Monkey365 Version: 0.97
Others: N/A

Additional context
The URL https://cdn.jsdelivr.net/gh/silverhack/monkey365assets@latest/assets/config.json now returns 301 before 200. Adding -MaximumRedirection 5 to the Invoke-WebRequest calls fixes the issue. Same fix needed in the localcdn block a few lines below in the same file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingimpact-lowIssue with low impact to codebaseseverity-highIssue with high severity

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions