T09 · Insecure Skill Coding Practices
- Location
scripts/runtime/freestocklineskill_runtime/sources.py:1405- Finding
Process-Wide Proxy and Egress-Control Bypass
- Content
View full analysis
Any: sink = io.StringIO() proxy_names = ["HTTP_PROXY", "HTTPS_PROXY", "ALL_PROXY", "http_proxy", "https_proxy", "all_proxy", "NO_PROXY", "no_proxy"] env = os.environ saved = {name: env.get(name) for name in proxy_names} for name in proxy_names: if name.lower() == "no_proxy": env[name] = "*" else: env.pop(name, None) try: with redirect_stdout(sink), redirect_stderr(sink): return func(*args, **kwargs) finally: for name, value in saved.items(): if value is None: env.pop(name, None) else: env[name] = value ``` ### Technical Analysis The `_quiet_call` helper removes all standard HTTP, HTTPS, and generic proxy environment variables and sets both `NO_PROXY` variants to `*` before invoking AKShare or efinance functions. This behavior forces supported networking libraries to attempt direct connections instead of respecting proxy settings established by the user, runtime, container, or organization. Such proxy settings may provide destination filtering, authentication, traffic inspection, audit logging, or network isolation. Bypassing them is unnecessary for the Skill's declared market-data functionality and exceeds the minimum network behavior needed to perform the requested queries. The mutation affects `os.environ`, which is process-global rather than local to the function call. In a multithreaded or shared Agent runtime, unrelated code can observe the modified environment and make direct outbound requests during the affected interval. The `finally` block restores the original values after ...[truncated 1832 chars]- Remediation
View remediation
