T09 · Insecure Skill Coding Practices
- Location
scripts/lhb.py:27- Finding
Unauthenticated HTTP Market Data Can Influence Stock Recommendations
- Content
View full analysis
Vulnerability Details
File Location:
scripts/lhb.py:27, 103-107; automatic invocation atscripts/radar_run.sh:112-117
Vulnerability Type: Unauthenticated external data source / data-integrity failure
Risk Level: MediumVulnerable Code
python API = "http://fffy520.gicp.net:8003/api"python def cmd_api(a): date, note = auto_date(a.date) if note: print(note) try: rows = http_json("{}/lhb/daily?date={}".format(API, date)).get("data") or [] except Exception as e: print("lhb-api 失败:{}".format(str(e)[:80])); return 1The default orchestration automatically invokes this source:
bash run x_lhb.log python3 skills/trading-desk/scripts/lhb.py api nonempty x_lhb.log && mark "↳ 龙虎榜/席位" "✅ 跑了" \ "lhb-api 席位明细 见 x_lhb.log" || \ mark "↳ 龙虎榜/席位" "🟡 无数据" "盘后17:30后才更新"Technical Analysis
The
lhb.py apicommand retrieves financial leaderboard and brokerage-seat information over plaintext HTTP. HTTP provides neither server authentication nor transport integrity, so an on-path attacker can modify or replace the JSON response.The response is parsed directly and treated as valid market evidence. The orchestration considers the step successful when its output file is nonempty and does not authenticate the source, verify a signature, or corroborate each result against an authenticated independent source.
This path is reachable through the documented one-click workflow because
radar_run.shautomatically invokeslhb.py apiduring its base analysis stage.Attack Path
- A user or agent launches the documented
radar_run.shworkflow. - The script invokes
lhb.py api. lhb.pysends a plaintext HTTP request tofffy520.gicp.net:8003.- An attacker controlling an intervening network segment, proxy, DNS path, or gateway intercepts the request.
- The attacker returns syntactically valid JSON containing fab ...[truncated 893 chars]
- A user or agent launches the documented
- Remediation
View remediation
Remediation Suggestions
- Replace the plaintext endpoint with an HTTPS endpoint using normal certificate and hostname validation.
- If the provider does not support HTTPS, remove it from automatic execution and fail closed rather than treating its output as trustworthy.
- Corroborate every material record against an independent authenticated source before incorporating it into recommendations.
- Add schema and semantic validation, including expected date, stock-code format, numeric ranges, and duplicate detection. These checks supplement but do not replace transport authentication.
- Change orchestration success criteria so that a merely nonempty log is insufficient; require authenticated retrieval and successful validation.
- Clearly label unverifiable data as unavailable and prevent it from affecting candidate ranking or recommendation rationale.
