⚡
AI Fix Prompts for Geocompare
Copy any prompt below into Claude, ChatGPT, or your AI coding assistant to automatically fix the issue. Each prompt includes full context, code location, and step-by-step fix instructions.
5
Total Prompts
1
Critical (P0)
4
High (P1)
0
Medium (P2)
0
Low (P3)
Download All (Markdown)
Download All (JSON)
Feed these prompts to any AI coder: Claude Code, Cursor, Copilot, GPT, Ollama
CRITICAL
⚡ quick-fix
#1
Remove hard-coded sast: [sast:aljefra/sql-injection-percent] SQL Injection via % String Formatting
security credentials sast
Expected outcome: Secret moved to environment variable, no hardcoded credentials in source
Files to modify:
geocompare/database/Database.pyPrompt (copy this into your AI assistant)
Fix a hardcoded credential in repository 'iandorsey00__geocompare'.
**Issue**: Hard-coded sast found ([sast:aljefra/sql-injection-percent] SQL Injection via % String Formatting)
**File**: geocompare/database/Database.py
**Line**: 347
**Severity**: CRITICAL
**Current code around the issue:**
```
342 | def debug_output_table(self, table_name):
343 | '''Print debug information for a table'''
344 | if not logger.isEnabledFor(logging.DEBUG):
345 | return
346 | logger.debug('%s table:', table_name)
>>> 347 | for row in self.c.execute('SELECT * FROM %s LIMIT 5' % table_name):
348 | logger.debug('%s', row)
349 |
350 | def debug_output_list(self, list_name):
351 | '''Print debug information for a list'''
352 | if not logger.isEnabledFor(logging.DEBUG):
```
**Required fix:**
1. Remove the hardcoded credential from the source code
2. Replace it with an environment variable read: `os.environ.get('SAST_KEY')` (Python) or `process.env.SAST_KEY` (JS)
3. Add the variable name to a `.env.example` file with a placeholder value
4. Ensure `.env` is in `.gitignore`
5. If this credential was ever committed to git, it should be considered compromised and rotated
**Do NOT:**
- Move the secret to a config file that gets committed
- Use a default fallback value that is a real credential
- Leave the old credential in a comment
Open data scored by Repobility · https://repobility.com
HIGH
⚒ significant
#2
Address OWASP A02 compliance gap
security compliance owasp
Expected outcome: OWASP A02 compliance issues resolved
Files to modify: Will be determined by the AI
Prompt (copy this into your AI assistant)
Address OWASP A02 (Cryptographic Failures) compliance gap in 'iandorsey00__geocompare'. **OWASP Category**: A02 -- Cryptographic Failures **Fix guidance**: Remove hardcoded secrets, use strong encryption (AES-256-GCM), enforce TLS, never store passwords in plaintext (use bcrypt/argon2). **Steps:** 1. Identify all code paths related to cryptographic failures 2. Apply the fixes described above 3. Add automated tests to verify the fix 4. Document any security assumptions in code comments
HIGH
⚙ moderate
#3
Fix quality gate failures (3 conditions)
quality-gate quality
Expected outcome: All quality gate conditions pass
Files to modify: Will be determined by the AI
Prompt (copy this into your AI assistant)
Repository 'iandorsey00__geocompare' is failing the quality gate. Failed conditions: - overall_score: actual 0.0 >= 50 (FAILED) - security_score: actual 0.0 >= 40 (FAILED) - critical_credentials: actual 1.0 <= 0 (FAILED) Fix each failing condition to make the repo pass the quality gate.
HIGH
⚒ significant
#4
Resolve 2 open issues
issues bugs
Expected outcome: All listed issues resolved
Files to modify:
geocompare/database/Database.py, geocompare/repository/sqlite_repository.pyPrompt (copy this into your AI assistant)
Repository 'iandorsey00__geocompare' has 2 open issues: - [CRITICAL] Hard-coded sast: [sast:aljefra/sql-injection-percent] SQL Injection via % String Formatting (geocompare/database/Database.py) - [MEDIUM] Hard-coded sast: [sast:aljefra/crypto-weak-hash] Weak Hash Algorithm (MD5/SHA1) (geocompare/repository/sqlite_repository.py) Resolve each issue. For security issues, apply the appropriate fix. For quality issues, refactor the affected code.
HIGH
⚙ moderate
#5
Fix 2 SAST/security code findings
sast security code-fix
Expected outcome: All SAST findings resolved
Files to modify:
geocompare/database/Database.py, geocompare/repository/sqlite_repository.pyPrompt (copy this into your AI assistant)
Static analysis found 2 security issues in 'iandorsey00__geocompare': - [CRITICAL] [sast:aljefra/sql-injection-percent] SQL Injection via % String Formatting at geocompare/database/Database.py:347 - [MEDIUM] [sast:aljefra/crypto-weak-hash] Weak Hash Algorithm (MD5/SHA1) at geocompare/repository/sqlite_repository.py:119 For each finding: - SQL injection: use parameterized queries - Command injection: use subprocess with list args, no shell=True - Path traversal: validate and sanitize paths - Insecure deserialization: use json instead of pickle - IaC misconfigs: apply the suggested fix from the rule