T09 · Insecure Skill Coding Practices
- Location
scripts/zhilian_parser.py:156- Finding
Unrestricted URL Fetching Enables Server-Side Request Forgery
- Content
View full analysis
Optional[Dict]: try: response = self.session.get(job_url, timeout=10) ``` ```python # scripts/zhilian_parser.py:156-159 def get_job_detail(self, job_url: str) -> Optional[Dict]: try: response = self.session.get(job_url, timeout=10) ``` ```python # scripts/qiancheng_parser.py:170-173 def get_job_detail(self, job_url: str) -> Optional[Dict]: try: response = self.session.get(job_url, timeout=10) ``` ### Technical Analysis All three parser classes expose a public `get_job_detail()` method that accepts an arbitrary URL and passes it directly to `requests.Session.get()`. The code does not validate: - The URL scheme. - The destination hostname. - Whether the resolved address is loopback, private, link-local, reserved, or multicast. - Whether the destination belongs to the recruitment platform handled by the parser. - Redirect destinations. The required functionality only needs access to known recruitment domains. Allowing arbitrary destinations creates an SSRF primitive that can access any HTTP service reachable from the process. The normal command-line search workflow does not currently invoke these methods, which reduces immediate exposure. However, they are public APIs and may be called directly by an integration or future workflow. In addition, job URLs extracted from HTML are not consistently restricted to expected platform domains. ### Attack Path 1. An attacker supplies a crafted URL through an integration that calls `get_job_detail()`. 2. The URL targets a service reachable from the Skill host, such as a loopback service, private-network application, or cloud metadata ...[truncated 1341 chars]- Remediation
View remediation
