{
  "id": "python/pip-dependency-confusion-shadowing",
  "signature": "WARNING: The repository located at private.example.com is not a trusted or secure host and is being ignored.",
  "signature_zh": "警告：位于 private.example.com 的仓库不是受信任或安全的主机，已被忽略。",
  "regex": "WARNING:\\ The\\ repository\\ located\\ at\\ private\\.example\\.com\\ is\\ not\\ a\\ trusted\\ or\\ secure\\ host\\ and\\ is\\ being\\ ignored\\.",
  "domain": "python",
  "category": "auth_error",
  "subcategory": null,
  "root_cause": "pip refuses to use a plain-HTTP index unless it is explicitly trusted; the warning causes pip to fall back to PyPI, potentially installing a typosquatted package (dependency confusion).",
  "root_cause_type": "generic",
  "root_cause_zh": "除非显式信任，pip 拒绝使用纯 HTTP 索引；该警告使 pip 回退到 PyPI，可能安装仿冒包（依赖混淆攻击）。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Restores HTTP access but does not add authentication, so the private index is still unauthenticated and vulnerable to MITM.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Forces all installs through PyPI, reintroducing dependency-confusion risk for internal package names.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The fallback to PyPI may silently install a malicious package with the same name.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Serve the private index over HTTPS with a valid certificate",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Configure credentials: pip config set global.index-url https://user:token@private.example.com/simple",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.88,
      "how": "Pin internal packages to the private index only: pip install --index-url https://private.example.com/simple --no-index internal-pkg",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.83,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-10-20",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}