T06 · System Persistence
- Location
recalc.py:18- Finding
Persistent LibreOffice Profile Modification Can Overwrite Existing User Macros
- Content
View full analysis
Sub RecalculateAndSave() ThisComponent.calculateAll() ThisComponent.store() ThisComponent.close(True) End Sub ''' try: with open(macro_file, 'w') as f: f.write(macro_content) ``` ### Technical Analysis The script installs executable LibreOffice Basic code directly into the current user's persistent LibreOffice profile. It uses the generic module path `Standard/Module1.xba`, which may already contain macros created by the user or another application. The existing-file check only searches for the substring `RecalculateAndSave`. If that substring is absent, the file is opened using mode `w`, which truncates the complete module before writing th ...[truncated 2110 chars]- Remediation
View remediation
