yuque-lakebook-export
Audited by Socket on Oct 2, 2026
3 alerts found:
Securityx2AnomalyThe fragment appears to implement a legitimate document-export workflow and contains no clear malware indicators. It has a significant unsafe-deserialization risk through yaml.load(..., yaml.Loader) if tocYml is untrusted, and a command-injection risk because output_path is passed unquoted to os.system() when open_output is enabled. Use yaml.safe_load() or an appropriately restricted loader, and replace os.system() with platform APIs or safely quoted subprocess calls. Review the imported parser and archive-extraction functions separately.
The code appears to implement archive extraction rather than contain malware. However, using tarfile.extractall() without validating archive member paths creates a significant path traversal and arbitrary file overwrite risk for untrusted archives. Extraction should restrict members to paths contained within extract_to and reject absolute paths, '..' components, symlinks, and hard links as appropriate.
The code appears to be an HTML-to-Markdown converter rather than malware. Its main security concerns are SSRF and uncontrolled downloading from card src values, possible filesystem path traversal or unintended file writes through configurable output path components, lack of request limits/timeouts, and unvalidated URLs in generated Markdown. The fragment is syntactically invalid as supplied because html_text has no assigned value. It should not process untrusted HTML without URL allowlisting, strict path containment checks, download limits, timeouts, and safe output handling.