other
- Location
generate_questions.py:53- Finding
Undisclosed Transmission of Résumé Data to a Third-Party API
- Content
View full analysis
Vulnerability Details
File Location:
generate_questions.py, lines 17-18 and 53-75
Vulnerability Type: Undisclosed sensitive data transmission
Risk Level: MediumVulnerable Code
python API_BASE = os.environ.get("OPENAI_API_BASE", "https://api.deepseek.com") MODEL = os.environ.get("LLM_MODEL", "deepseek-chat")python def call_llm(prompt: str) -> str: if not API_KEY: return "[Error] Set the OPENAI_API_KEY or DEEPSEEK_API_KEY environment variable" payload = json.dumps({ "model": MODEL, "messages": [ {"role": "system", "content": "You are an experienced HR and career consultant who specializes in analyzing job requirements and résumés and predicting interview questions. Answer in Chinese."}, {"role": "user", "content": prompt} ], "temperature": 0.7, }).encode("utf-8") req = urllib.request.Request( f"{API_BASE}/chat/completions", data=payload, headers={ "Content-Type": "application/json", "Authorization": f"Bearer {API_KEY}", } ) with urllib.request.urlopen(req, timeout=60) as r: data = json.loads(r.read()) return data["choices"][0]["message"]["content"]The quoted English system-message text above is a direct translation for report-language compliance; the executable source contains the equivalent Chinese string.
Technical Analysis
The application reads job descriptions and résumés, embeds up to 3,000 characters from each document into a prompt, and sends that prompt to an OpenAI-compatible endpoint. The default endpoint is DeepSeek, while
OPENAI_API_BASEpermits the destination to be changed.Résumés commonly contain names, contact information, employment history, education details, and other personal or confidential information. The project documentation does not clearly disclose that this in ...[truncated 1757 chars]
- Remediation
View remediation
Remediation Suggestions
- Clearly disclose before processing that document content will be transmitted to an external LLM provider.
- Identify the default provider, applicable privacy terms, expected retention behavior, and the exact categories of data transmitted.
- Require explicit user consent before sending résumé or job-description content.
- Provide a local-processing or redaction mode for users who cannot transmit sensitive data externally.
- Minimize transmitted data and automatically redact email addresses, telephone numbers, physical addresses, government identifiers, and other unnecessary personal information.
- Validate
OPENAI_API_BASEagainst an explicit allowlist of approved HTTPS origins. - Reject non-HTTPS URLs, embedded credentials, unexpected ports, redirects to unapproved hosts, and malformed endpoint values.
- Use provider credentials with minimal scope, restricted quotas, and isolated billing limits.
- Avoid logging prompts, authorization headers, or API responses containing personal information.
- Add documentation covering data flow, consent, retention, deletion, and incident-response procedures.
