Skip to content

Conversation

garland3
Copy link

This PR addresses multiple security issues:

Changes include:

  • Modified toyplot/html.py to escape script closing tags.
  • Updated toyplot/require.py hyperlink function with scheme validation.
  • Hardened toyplot/reportlab/png.py Ghostscript invocation.
  • Added unit tests for security fixes.
  • Updated CI to run security tests.

- Escape </script> sequences in generated JavaScript to prevent injection.
- Add unit test suite with test for script escaping.
- Integrate unit tests into CI/CD workflow.

Addresses security issue where user-controlled data could inject arbitrary script.
…s#219)

- Only allow http, https, mailto, ftp, or relative URLs in require.hyperlink
- Add unit tests for safe and unsafe schemes

Addresses security issue where javascript: and data: URIs could be used for injection.
- Use shutil.which() and os.path.realpath() for absolute Ghostscript path
- Ensure -dSAFER is included in both render() and render_frames()
- Use consistent _gs_resolution in render_frames()
- Add unit test for Ghostscript command setup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant