CVE-2017-8295: WordPress < 5.5 - Password Reset Poisoning via Host Header Injection

2026-11-29 PoC Public

Description

WordPress before 5.5 derives the password-reset email's From/Return-Path address from $_SERVER['SERVER_NAME'] in wp_mail() (wp-includes/pluggable.php). On servers where SERVER_NAME follows the client Host header (e.g. Apache with UseCanonicalName Off, or a default/IP-based vhost), an unauthenticated attacker can POST to wp-login.php?action=lostpassword with a crafted Host header so the reset email's From/Return-Path points at an attacker-controlled domain. If that message bounces or is auto-replied, the secret reset link is delivered to the attacker, enabling account takeover. The injected host is never reflected in the HTTP response and triggers no out-of-band callback, so this detection is version-based (the SERVER_NAME sender was replaced with network_home_url() in 5.5).

Details

CVE
CVE-2017-8295 · CVE.org
Severity
中危
Published
PoC
Public

PoC

id: CVE-2017-8295

info:
  name: WordPress < 5.5 - Password Reset Poisoning via Host Header Injection
  author: DhiyaneshDk
  severity: medium
  description: |
    WordPress before 5.5 derives the password-reset email's From/Return-Path address from $_SERVER['SERVER_NAME'] in wp_mail() (wp-includes/pluggable.php). On servers where SERVER_NAME follows the client Host header (e.g. Apache with UseCanonicalName Off, or a default/IP-based vhost), an unauthenticated attacker can POST to wp-login.php?action=lostpassword with a crafted Host header so the reset email's From/Return-Path points at an attacker-controlled domain. If that message bounces or is auto-replied, the secret reset link is delivered to the attacker, enabling account takeover. The injected host is never reflected in the HTTP response and triggers no out-of-band callback, so this detection is version-based (the SERVER_NAME sender was replaced with network_home_url() in 5.5).
  impact: |
    Attackers can reset arbitrary user passwords and obtain reset keys by exploiting email bounce or resend mechanisms, potentially leading to account takeover.
  remediation: |
    Update to WordPress 4.7.5 or later versions that fix this issue.
  reference:
    - https://legalhackers.com/advisories/WordPress-Exploit-4-7-Unauth-Password-Reset-0day-CVE-2017-8295.html
    - https://www.exploit-db.com/exploits/41963
    - https://core.trac.wordpress.org/ticket/25239
    - https://nvd.nist.gov/vuln/detail/CVE-2017-8295
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
    cvss-score: 5.9
    cve-id: CVE-2017-8295
    epss-score: 0.32312
    epss-percentile: 0.98723
    cwe-id: CWE-640
  metadata:
    verified: true
    max-request: 2
    shodan-query: http.component:"WordPress"
  tags: cve,cve2017,wordpress,wp,password-reset,host-header,vkev,passive

http:
  - method: GET
    path:
      - "{{BaseURL}}/"
      - "{{BaseURL}}/feed/"

    stop-at-first-match: true

    matchers:
      - type: dsl
        dsl:
          - "compare_versions(version, '< 5.5')"

    extractors:
      - type: regex
        name: version
        part: body
        group: 1
        regex:
          - 'name="generator" content="WordPress ([0-9.]+)"'
          - 'wordpress\.org/\?v=([0-9.]+)'
          - 'wp-emoji-release\.min\.js\?ver=([0-9.]+)'
# digest: 4a0a0047304502207503cacb8cdbe7d1f89316967fa1e19fa2989fcae39f25fa7c5fd8513f83ddc2022100acff099b70253441ee597ac4a54f475d12d3988d512f59b19bcb3f3913aafb06:922c64590222798bb761d5b6d8e72950

# Visit https://trap.biu.life/ to view exploit trends for this vulnerability.

References

微信搜一搜 biu.life