Skip to content

Commit 21c0bba

Browse files
committed
fix: resolve CodeQL clear-text logging alerts in filtering.py
Replace `exc` with `type(exc).__name__` in all 6 debug logger calls to break CodeQL's taint chain from api_key through OutlineClient exceptions. The exception class name is sufficient for debugging and is not derived from sensitive data. https://claude.ai/code/session_0122umEU4tP9VMzCTrV6SdZN
1 parent 7f33df7 commit 21c0bba

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/mcp_outline/features/dynamic_tools/filtering.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ async def _get_role_blocked_tools(
8080
else:
8181
logger.debug(
8282
"auth.info check failed (%s), skipping role check",
83-
exc,
83+
type(exc).__name__,
8484
)
8585
except Exception as exc:
8686
logger.debug(
8787
"auth.info check failed (%s), skipping role check",
88-
exc,
88+
type(exc).__name__,
8989
)
9090
return set()
9191

@@ -144,7 +144,7 @@ async def _get_scope_blocked_tools(
144144
else:
145145
logger.debug(
146146
"apiKeys.list failed (%s), skipping scope check",
147-
e,
147+
type(e).__name__,
148148
)
149149
return set(), False
150150

@@ -177,7 +177,7 @@ async def _get_scope_blocked_tools(
177177
except Exception as exc:
178178
logger.debug(
179179
"Dynamic tool list: scope check failed (%s), skipping scope check",
180-
exc,
180+
type(exc).__name__,
181181
)
182182
return set(), False
183183

@@ -208,7 +208,7 @@ async def get_blocked_tools(
208208
logger.debug(
209209
"Dynamic tool list: client init failed (%s),"
210210
" returning full tool list",
211-
exc,
211+
type(exc).__name__,
212212
)
213213
return set()
214214

@@ -270,7 +270,7 @@ async def filtered_list_tools() -> list[MCPTool]:
270270
except Exception as exc:
271271
logger.debug(
272272
"Dynamic tool filtering failed (%s), returning full tool list",
273-
exc,
273+
type(exc).__name__,
274274
)
275275

276276
return tools

0 commit comments

Comments
 (0)