other
- Location
scripts/prior-art-search.py:77- Finding
Automatic disclosure of potentially confidential invention keywords to a third-party API
- Content
View full analysis
Vulnerability Details
File Location:
scripts/prior-art-search.py, lines 77-91
Vulnerability Type: Sensitive data disclosure without explicit per-request confirmation
Risk Level: MediumComplete Code Snippet
python url = f"{self.base_url}/patent/search" headers = { "Content-Type": "application/json", "X-App-Id": self.app_id, "X-App-Key": self.app_key } payload = { "query": query, "page_num": page, "page_size": page_size } response = requests.post(url, json=payload, headers=headers, timeout=30)The API client is enabled automatically whenever the expected credentials are present:
python use_api = not args.free and searcher.zhiyuya.available report = searcher.generate_report(keywords, use_api)Technical Analysis
Patent-search keywords may describe inventions before filing and can therefore constitute confidential business information or material relevant to patent novelty. The script transmits the complete user-supplied query to
https://open.zhihuiya.com/v1/patent/searchwhenever API credentials are available. It does not show the exact destination and payload immediately before transmission, request affirmative consent, or warn that invention information will be disclosed to a third party.The network operation is functionally relevant to the declared deep prior-art search capability and uses HTTPS with a timeout. It therefore does not appear covert or unrelated to the Skill. Nevertheless, automatically selecting the remote mode merely because credentials exist exceeds a privacy-preserving default. The minimum-privilege design would require an explicit remote-search option or confirmation and should transmit only the minimum search terms required.
The API credentials are also transmitted in request headers. That is necessary for authenticated API access, but it makes endpoint integrity and TLS validation critical.
Attack Path
...[truncated 1236 chars]
- Remediation
View remediation
Remediation Suggestions
- Make local/free mode the default and require an explicit
--remoteor--provider zhihuiyaoption. - Before the first transmission, display the destination host and identify the fields that will leave the machine; require confirmation in interactive use.
- Add a non-interactive consent flag such as
--allow-networkfor automation. - Warn users not to submit unpublished enabling details unless they have reviewed the provider's privacy, retention, and confidentiality terms.
- Minimize queries by encouraging abstract search terms rather than complete technical descriptions.
- Document data categories, destination, purpose, retention considerations, and the effect of
--free. - Permit an administrator-controlled endpoint allowlist and reject redirects to unapproved hosts.
- Use scoped, revocable API credentials and rotate them after suspected exposure.
- Make local/free mode the default and require an explicit
