Summary
Tactical RMM's report-template preview can read local files when user-supplied Markdown contains file:// links that WeasyPrint resolves while generating a PDF. A user with report management permission could potentially retrieve sensitive files, including the Django SECRET_KEY, which the description says is reused as the NATS password.
Affected context
The issue occurs in the /reporting/templates/preview/ endpoint when report templates are rendered into PDFs. It is risky when user-supplied template_md can contain file references that WeasyPrint resolves and embeds in the returned PDF, and an account has report management permission.
Exploit preconditions
- Attack surface: The report-template preview endpoint
- Required access: Report management permission
- Trigger point: PDF generation using user-supplied
template_md - Why exploitation is possible: The renderer resolves local
file://references and may include the referenced file contents in the PDF
Why this happens
The application allows user-controlled template content to influence which files the PDF renderer accesses. This is an external control of file names or paths, mapping to CWE-73. The insecure pattern is passing untrusted references to a rendering component that can resolve local files without sufficiently restricting permitted schemes and paths.
Potential impact
- Attackers may read sensitive files accessible to the application process.
- Disclosure of the Django
SECRET_KEYcould expose credentials or enable further compromise, depending on how it is used. - Reuse of that key as the NATS password could allow unauthorized access to NATS.
- An attacker could potentially publish runscript commands to managed agents, as described, increasing the risk of fleet-wide impact.
General mitigation guidance
Mitigation generally focuses on separating template input from local file access and limiting the renderer's capabilities.
- Use secure-by-default rendering settings that disable local-file access and unnecessary URL schemes.
- Restrict templates to trusted content or a narrowly defined set of approved assets.
- Apply allowlists and path boundaries where resource loading is required; reject references outside those boundaries.
- Keep secrets out of files or credentials accessible to the rendering process, and avoid reusing secrets across services.
- Run rendering workloads with least privilege and limited access to the filesystem and messaging systems.
How teams detect issues like this
- Review renderer configuration and code paths that pass user-controlled templates or URLs to PDF-generation libraries.
- Use static analysis and code review checks to flag local-file URL handling and uncontrolled resource loading.
- Monitor preview requests and generated PDFs for unexpected local resource references or sensitive content.
- Enforce policies that disable local-file access in rendering components and restrict which resources they may fetch.
- Automated security review tools can help identify these patterns during development.

