Skip to content

Commit d103ab4

Browse files
author
Franz646
committed
fix: avoid information exposure through exceptions (CWE-209, CWE-497)
Replace str(exc) with generic 'Internal server error' in all API error responses. Exception details are still logged server-side via _LOGGER.exception(). Bump 2.2.1 -> 2.2.2
1 parent 54369d3 commit d103ab4

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

custom_components/orphan_cleaner/const.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@
4747
PANEL_ICON = "mdi:broom"
4848

4949
# Versione corrente (usata per cache-busting)
50-
VERSION = "2.2.1"
50+
VERSION = "2.2.2"

custom_components/orphan_cleaner/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"domain": "orphan_cleaner",
33
"name": "Orphan Entity Cleaner",
4-
"version": "2.2.1",
4+
"version": "2.2.2",
55
"documentation": "https://github.com/Franz646/orphan-cleaner",
66
"issue_tracker": "https://github.com/Franz646/orphan-cleaner/issues",
77
"codeowners": [

custom_components/orphan_cleaner/panel_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ async def get(self, request: web.Request) -> web.Response:
7979
return web.Response(
8080
status=500,
8181
content_type="application/json",
82-
text=json.dumps({"error": str(exc), "orphans": [], "total": 0}),
82+
text=json.dumps({"error": "Internal server error", "orphans": [], "total": 0}),
8383
)
8484

8585

@@ -121,7 +121,7 @@ async def post(self, request: web.Request) -> web.Response:
121121
return web.Response(
122122
status=500,
123123
content_type="application/json",
124-
text=json.dumps({"error": str(exc)}),
124+
text=json.dumps({"error": "Internal server error"}),
125125
)
126126

127127

@@ -174,7 +174,7 @@ async def post(self, request: web.Request) -> web.Response:
174174
return web.Response(
175175
status=500,
176176
content_type="application/json",
177-
text=json.dumps({"error": str(exc)}),
177+
text=json.dumps({"error": "Internal server error"}),
178178
)
179179

180180
# ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)