chore(changelog): update
All checks were successful
Code check / Check code (push) Successful in 1m9s

Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
This commit is contained in:
2025-09-02 00:11:35 +05:00
parent 2e93073446
commit 2547c7c78d
2 changed files with 13 additions and 14 deletions

View File

@@ -3,6 +3,19 @@
Все заметные изменения в этом проекте фиксируются в этом файле.
Формат основан на [Keep a Changelog](https://keepachangelog.com/) и придерживается принципов [Semantic Versioning](https://semver.org/).
## [Unreleased]
### Added
### Changed
- Добавлена проверка безопасности в theme_manager.py для всех сторонних тем, с проверкой на запрещённые модули и функции (подробности см. в коде theme_manager под полями FORBIDDEN_MODULES и FORBIDDEN_FUNCTIONS)
### Fixed
### Contributors
---
## [0.1.5] - 2025-08-31
### Added

View File

@@ -1,7 +1,6 @@
import importlib.util
import os
import ast
import re
from portprotonqt.logger import get_logger
from PySide6.QtSvg import QSvgRenderer
from PySide6.QtGui import QIcon, QColor, QFontDatabase, QPixmap, QPainter
@@ -34,13 +33,6 @@ FORBIDDEN_FUNCTIONS = {
"__import__",
}
FORBIDDEN_PROPERTIES = {
"box-shadow",
"backdrop-filter",
"cursor",
"text-shadow",
}
def check_theme_safety(theme_file: str) -> bool:
"""
Проверяет файл темы на наличие запрещённых модулей и функций.
@@ -51,12 +43,6 @@ def check_theme_safety(theme_file: str) -> bool:
with open(theme_file) as f:
content = f.read()
# Проверка на запрещённые QSS-свойства
for prop in FORBIDDEN_PROPERTIES:
if re.search(rf"{prop}\s*:", content, re.IGNORECASE):
logger.error(f"Unknown QSS property found '{prop}' in file {theme_file}")
has_errors = True
# Проверка на опасные импорты и функции
try:
tree = ast.parse(content)