T09 · Insecure Skill Coding Practices
Error
- Location
- main.py:244
- Finding
- Unverified fixed-coordinate automation can capture or interact with unintended applications<![CDATA[ ## Vulnerability Details **File Location**: `main.py:244-252`, `main.py:280-282`, `boss_automation.py:144-211` **Vulnerability Type**: Unvalidated GUI automation and unintended action execution **Risk Level**: High ### Vulnerable Code `main.py:244-252`: ```python # 3. Screenshot capture_screenshot(config=cfg) # 4. Communication workflow (automatically executed without manual confirmation) log_step("Execute communication workflow") click_chat_button(config=cfg) activate_chat_input(config=cfg) send_chat_message(config=cfg) browser_go_back(config=cfg) ``` `main.py:280-282`: ```python while True: process_job(cfg) time.sleep(1) ``` `boss_automation.py:144-211`: ```python def click_job_item(self): """Click a job item in the job list.""" pyautogui.moveTo(self.job_start[0], self.job_start[1], duration=0.5) time.sleep(0.3) pyautogui.click(self.job_start[0], self.job_start[1]) self._random_delay() def capture_job_description(self, save_path=None): """ Capture the job-description area. Parameters: save_path: Optional screenshot destination. Returns: PIL.Image: Screenshot object. """ region = self.screenshot_region x1, y1, x2, y2 = region width = x2 - x1 height = y2 - y1 screenshot = pyautogui.screenshot(region=(x1, y1, width, height)) if save_path: screenshot.save(save_path) self._random_delay() return screenshot def click_chat_button(self): """Click the immediate-chat button.""" pyautogui.moveTo(self.chat_button[0], self.chat_button[1], duration=0.5) time.sleep(0.3) pyautogui.click(self.chat_button[0], self.chat_button[1]) self._random_delay() def activate_chat_input(self): """Activate the chat input.""" pyautogui.moveTo(self.chat_input[0], self.chat_input[1], duration=0.5) time.sleep(0.3) pyautogui.click(self.chat_input[0], self.chat_input[1]) self._random_delay() def browser_go_back(self): """Navi ...[truncated 3219 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Verify the foreground process, window title, and expected browser origin before every screenshot, click, paste, and keyboard action. 2. Confirm that the current URL is the configured Boss Zhipin domain and reject redirects or unexpected pages. 3. Replace fixed coordinates with element-aware browser automation or validated image recognition. 4. Implement the documented OCR and matching stages as mandatory gates before initiating communication. 5. Display the selected job, recipient, and generated message and require explicit user confirmation before pressing Enter. 6. Add a dry-run mode that records intended actions without clicking or sending. 7. Bound the processing loop by job count, runtime, and message count, and apply a conservative rate limit. 8. Abort immediately when window focus, screen resolution, page structure, or target recognition differs from the expected state. 9. Keep the PyAutoGUI fail-safe enabled, but treat it only as an emergency control rather than target validation. 10. Avoid taking or retaining screenshots unless required; restrict permissions on the output directory and provide automatic retention limits. ]]>
