T08 · Insecure Dependencies
- Location
requirements-optional.txt:1- Finding
Unpinned Authentication Dependency Can Expose Truth Social Credentials
- Content
View full analysis
=0.2.0 ``` The dependency receives the credentials in `scripts/fetch_truth_social.py:34-45`: ```python username = os.environ.get("TRUTHSOCIAL_USERNAME") password = os.environ.get("TRUTHSOCIAL_PASSWORD") token = os.environ.get("TRUTHSOCIAL_TOKEN") if not token and not (username and password): return [], "未配置 Truth Social:请设置 TRUTHSOCIAL_USERNAME / TRUTHSOCIAL_PASSWORD 或 TRUTHSOCIAL_TOKEN" handle = handle or os.environ.get("TRUTHSOCIAL_HANDLE") or DEFAULT_HANDLE created_after = datetime.now(timezone.utc) - timedelta(days=days_back) try: api = tb.Api(username=username, password=password, token=token) except Exception as e: return [], f"Truth Social 登录失败: {e}" ``` ### Technical Analysis The version constraint `truthbrush>=0.2.0` permits installation of any current or future release satisfying the lower bound. No exact version, package hash, lock file, or integrity verification constrains the code that will be installed. At runtime, the package is imported into the main Python process and directly receives either a username and password or an authenticated browser token. Imported Python packages execute with the same operating-system permissions as the Skill and can inspect the full process environment, access local files available to that user, and initiate arbitrary network requests. The dependency is relevant to the optional Truth Social feature, so using a client library is not inherently excessive. The risk arises from allowing unaudited future versions to operate with sensitive credentials. ### Attack Path 1. An att ...[truncated 1084 chars]- Remediation
View remediation
``` 2. Generate and verify package hashes, and install with `pip --require-hashes`. 3. Use a lock file or controlled internal package mirror to ensure reproducible installations. 4. Review transitive dependencies and repeat that review before upgrading. 5. Prefer a narrowly scoped, revocable token instead of a reusable account password. 6. Run the optional Truth Social integration in an isolated process or container with: - A minimal environment containing only the required token. - Restricted filesystem permissions. - Network egress limited to the required Truth Social endpoints. - No access to unrelated OpenClaw secrets. 7. Avoid recommending extraction of a full browser session token unless its scope and revocation procedure are clearly documented. ]]>
