chore(changelog): update
All checks were successful
Code check / Check code (push) Successful in 1m9s
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:
13
CHANGELOG.md
13
CHANGELOG.md
@@ -3,6 +3,19 @@
|
|||||||
Все заметные изменения в этом проекте фиксируются в этом файле.
|
Все заметные изменения в этом проекте фиксируются в этом файле.
|
||||||
Формат основан на [Keep a Changelog](https://keepachangelog.com/) и придерживается принципов [Semantic Versioning](https://semver.org/).
|
Формат основан на [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
|
## [0.1.5] - 2025-08-31
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
import importlib.util
|
import importlib.util
|
||||||
import os
|
import os
|
||||||
import ast
|
import ast
|
||||||
import re
|
|
||||||
from portprotonqt.logger import get_logger
|
from portprotonqt.logger import get_logger
|
||||||
from PySide6.QtSvg import QSvgRenderer
|
from PySide6.QtSvg import QSvgRenderer
|
||||||
from PySide6.QtGui import QIcon, QColor, QFontDatabase, QPixmap, QPainter
|
from PySide6.QtGui import QIcon, QColor, QFontDatabase, QPixmap, QPainter
|
||||||
@@ -34,13 +33,6 @@ FORBIDDEN_FUNCTIONS = {
|
|||||||
"__import__",
|
"__import__",
|
||||||
}
|
}
|
||||||
|
|
||||||
FORBIDDEN_PROPERTIES = {
|
|
||||||
"box-shadow",
|
|
||||||
"backdrop-filter",
|
|
||||||
"cursor",
|
|
||||||
"text-shadow",
|
|
||||||
}
|
|
||||||
|
|
||||||
def check_theme_safety(theme_file: str) -> bool:
|
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:
|
with open(theme_file) as f:
|
||||||
content = f.read()
|
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:
|
try:
|
||||||
tree = ast.parse(content)
|
tree = ast.parse(content)
|
||||||
|
Reference in New Issue
Block a user