T09 · Insecure Skill Coding Practices
- Location
scripts/translate_utils.py:125- Finding
Automatic Disclosure of PDF Text to External Translation Services
- Content
View full analysis
MAX_TRANSLATE_BLOCKS: all_texts_flat = all_texts_flat[:MAX_TRANSLATE_BLOCKS] page_text_index = page_text_index[:MAX_TRANSLATE_BLOCKS] translated_flat = batch_translate( all_texts_flat, verbose=verbose_translate, ) ``` ```python # scripts/translate_utils.py:125-134 for engine in ['google', 'alibaba', 'baidu', 'youdao', 'bing']: try: result = ts.translate_text("test", to_language='zh', translator=engine) if result: _translators_engine = engine return engine except Exception: continue ``` ```python # scripts/translate_utils.py:168-175 result = ts.translate_text( protected_text, from_language=from_lang, to_language=to_lang, translator=engine, ) if result: result = _restore_terms(result, protected_map) return result ``` ```python # scripts/translate_utils.py:201-225 api_base = os.environ.get("OPENAI_API_BASE", "http://localhost:11434/v1") api_key = os.environ.get("OPENAI_API_KEY ...[truncated 3314 chars]- Remediation
View remediation
