Skip to content

Commit b389a14

Browse files
h4x3rotabclaude
andcommitted
fix: address CodeQL security findings
- Avoid exposing exception details to external users in agent.py (/ and /chat endpoints now return generic error messages) - Remove unused imports (json, sys) in verify.py Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7e5d9ba commit b389a14

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

confidential-ai/agents/agent.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ def index():
140140
"app_id": info.app_id,
141141
}
142142
)
143-
except Exception as e:
144-
return jsonify({"status": "running", "error": str(e)})
143+
except Exception:
144+
return jsonify({"status": "running", "error": "Failed to retrieve agent info"})
145145

146146

147147
@app.route("/attestation")
@@ -169,8 +169,8 @@ def chat():
169169
"wallet": get_account().address,
170170
}
171171
)
172-
except Exception as e:
173-
return jsonify({"error": str(e)}), 500
172+
except Exception:
173+
return jsonify({"error": "Failed to process chat request"}), 500
174174

175175

176176
@app.route("/sign", methods=["POST"])

confidential-ai/inference/verify.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
import argparse
1212
import hashlib
13-
import json
14-
import sys
1513

1614
import requests
1715

0 commit comments

Comments
 (0)