{
  "sha": "90d1d98527c0c13a656b2fc10cfa5f3a234f6fd5",
  "node_id": "C_kwDOKDyQLdoAKDkwZDFkOTg1MjdjMGMxM2E2NTZiMmZjMTBjZmE1ZjNhMjM0ZjZmZDU",
  "commit": {
    "author": {
      "name": "betaxab",
      "email": "30405429+betaxab@users.noreply.github.com",
      "date": "2026-03-21T13:35:54Z"
    },
    "committer": {
      "name": "GitHub",
      "email": "noreply@github.com",
      "date": "2026-03-21T13:35:54Z"
    },
    "message": "payments: Preventing weak md5 hash verification (#328)",
    "tree": {
      "sha": "09ad061ec3e34526479d07787af7a6ee5827d252",
      "url": "https://api.github.com/repos/wyx2685/v2board/git/trees/09ad061ec3e34526479d07787af7a6ee5827d252"
    },
    "url": "https://api.github.com/repos/wyx2685/v2board/git/commits/90d1d98527c0c13a656b2fc10cfa5f3a234f6fd5",
    "comment_count": 0,
    "verification": {
      "verified": true,
      "reason": "valid",
      "signature": "-----BEGIN PGP SIGNATURE-----\n\nwsFcBAABCAAQBQJpvp66CRC1aQ7uu5UhlAAAD48QAEwZuCGbvgAH0LjErrWdLluS\nkzCnnLEun4Mc3mRoX2m64QMRmJiARzLJ0TVcu5zRN2x4LInh4gQSk3wpvDmYwA+C\nE7mN+08FayKZ8VlJ5Ocd/Uf9oL/3ofenWpWKr1DiHOxiiZ/mI4bgapuPqGaV1p5V\nIOsssZiaxEhUSWnm/SHYDNA/Sx72zLb39+0swrRlVHYQuKG/DvcPbxrezdUtYUGN\ni1XVKWc7txHD6Ygp7ZIkqlfJtRJZsz5oNTzZlUUvfSpRUCB6A1Krw+cOQAgpeg20\nQyhuIuCfBYFCNkG3FNrt24XMz7h1D5cothMVh/XUpY+7VLJ8Ng2jdUirREH8GU0y\npI32gDZWtOPVknaYlDzYOqHOVGdjRBmigkuk+zgGXEJgpwoBpj2r/4zus6Bpmtdo\nlMFHxNKK9xODth2KPY4OikMCKLJKlB1P8aXbbxip4FbPuy1F2ylAbk6yzKzzx6iT\n7u+pAfvUn3rSN0hCISGGUnbsTNNfLhGtW4k5DBUFBUwzRcZONLHr/nGM6rxXOiAo\ny6sWSqZdbIuLqseeAgBAurK3LGLEHwUvKkhPi3OIZwjJylWC+jd1piFr+7KTcelx\njNu+5680jjySCIcZG57zw0PvAaj1v6lK2kUIKv4pppNWisEH+yVmybZjViL6FAgS\nvxEx09/ycXG1Q59Sp0vL\n=otPO\n-----END PGP SIGNATURE-----\n",
      "payload": "tree 09ad061ec3e34526479d07787af7a6ee5827d252\nparent 00071d467da4e4f283c6e3f6b1a160060ac3dd7c\nauthor betaxab <30405429+betaxab@users.noreply.github.com> 1774100154 +0800\ncommitter GitHub <noreply@github.com> 1774100154 +0800\n\npayments: Preventing weak md5 hash verification (#328)",
      "verified_at": "2026-03-21T13:35:56Z"
    }
  },
  "url": "https://api.github.com/repos/wyx2685/v2board/commits/90d1d98527c0c13a656b2fc10cfa5f3a234f6fd5",
  "html_url": "https://github.com/wyx2685/v2board/commit/90d1d98527c0c13a656b2fc10cfa5f3a234f6fd5",
  "comments_url": "https://api.github.com/repos/wyx2685/v2board/commits/90d1d98527c0c13a656b2fc10cfa5f3a234f6fd5/comments",
  "author": {
    "login": "betaxab",
    "id": 30405429,
    "node_id": "MDQ6VXNlcjMwNDA1NDI5",
    "avatar_url": "https://avatars.githubusercontent.com/u/30405429?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/betaxab",
    "html_url": "https://github.com/betaxab",
    "followers_url": "https://api.github.com/users/betaxab/followers",
    "following_url": "https://api.github.com/users/betaxab/following{/other_user}",
    "gists_url": "https://api.github.com/users/betaxab/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/betaxab/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/betaxab/subscriptions",
    "organizations_url": "https://api.github.com/users/betaxab/orgs",
    "repos_url": "https://api.github.com/users/betaxab/repos",
    "events_url": "https://api.github.com/users/betaxab/events{/privacy}",
    "received_events_url": "https://api.github.com/users/betaxab/received_events",
    "type": "User",
    "user_view_type": "public",
    "site_admin": false
  },
  "committer": {
    "login": "web-flow",
    "id": 19864447,
    "node_id": "MDQ6VXNlcjE5ODY0NDQ3",
    "avatar_url": "https://avatars.githubusercontent.com/u/19864447?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/web-flow",
    "html_url": "https://github.com/web-flow",
    "followers_url": "https://api.github.com/users/web-flow/followers",
    "following_url": "https://api.github.com/users/web-flow/following{/other_user}",
    "gists_url": "https://api.github.com/users/web-flow/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/web-flow/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/web-flow/subscriptions",
    "organizations_url": "https://api.github.com/users/web-flow/orgs",
    "repos_url": "https://api.github.com/users/web-flow/repos",
    "events_url": "https://api.github.com/users/web-flow/events{/privacy}",
    "received_events_url": "https://api.github.com/users/web-flow/received_events",
    "type": "User",
    "user_view_type": "public",
    "site_admin": false
  },
  "parents": [
    {
      "sha": "00071d467da4e4f283c6e3f6b1a160060ac3dd7c",
      "url": "https://api.github.com/repos/wyx2685/v2board/commits/00071d467da4e4f283c6e3f6b1a160060ac3dd7c",
      "html_url": "https://github.com/wyx2685/v2board/commit/00071d467da4e4f283c6e3f6b1a160060ac3dd7c"
    }
  ],
  "stats": {
    "total": 16,
    "additions": 13,
    "deletions": 3
  },
  "files": [
    {
      "sha": "3a3de38f5cb6f4067b62fb06aae8d36e4b51b8c8",
      "filename": "app/Payments/BEasyPaymentUSDT.php",
      "status": "modified",
      "additions": 2,
      "deletions": 1,
      "changes": 3,
      "blob_url": "https://github.com/wyx2685/v2board/blob/90d1d98527c0c13a656b2fc10cfa5f3a234f6fd5/app%2FPayments%2FBEasyPaymentUSDT.php",
      "raw_url": "https://github.com/wyx2685/v2board/raw/90d1d98527c0c13a656b2fc10cfa5f3a234f6fd5/app%2FPayments%2FBEasyPaymentUSDT.php",
      "contents_url": "https://api.github.com/repos/wyx2685/v2board/contents/app%2FPayments%2FBEasyPaymentUSDT.php?ref=90d1d98527c0c13a656b2fc10cfa5f3a234f6fd5",
      "patch": "@@ -71,7 +71,8 @@ public function notify($params)\n         ksort($params);\n         reset($params);\n         $str = stripslashes(urldecode(http_build_query($params))) . $this->config['bepusdt_apitoken'];\n-        if ($sign !== md5($str)) {\n+        $generateSignature = md5($str);\n+        if (!hash_equals($generateSignature, $sign)) {\n             return('cannot pass verification');\n         }\n         $status = $params['status'];"
    },
    {
      "sha": "5dd32bdf345af0897fe4fb00d2e74d91135b5348",
      "filename": "app/Payments/EPay.php",
      "status": "modified",
      "additions": 9,
      "deletions": 1,
      "changes": 10,
      "blob_url": "https://github.com/wyx2685/v2board/blob/90d1d98527c0c13a656b2fc10cfa5f3a234f6fd5/app%2FPayments%2FEPay.php",
      "raw_url": "https://github.com/wyx2685/v2board/raw/90d1d98527c0c13a656b2fc10cfa5f3a234f6fd5/app%2FPayments%2FEPay.php",
      "contents_url": "https://api.github.com/repos/wyx2685/v2board/contents/app%2FPayments%2FEPay.php?ref=90d1d98527c0c13a656b2fc10cfa5f3a234f6fd5",
      "patch": "@@ -58,9 +58,17 @@ public function notify($params)\n         ksort($params);\n         reset($params);\n         $str = stripslashes(urldecode(http_build_query($params))) . $this->config['key'];\n-        if ($sign !== md5($str)) {\n+        $generateSignature = md5($str);\n+        if (!hash_equals($generateSignature, $sign)) {\n             return false;\n         }\n+\n+        // 强制要求交易状态为成功，避免未支付/处理中状态被误入账\n+        $tradeStatus = $params['trade_status'] ?? '';\n+        if ($tradeStatus !== 'TRADE_SUCCESS') {\n+            return('fail');\n+        }\n+\n         return [\n             'trade_no' => $params['out_trade_no'],\n             'callback_no' => $params['trade_no']"
    },
    {
      "sha": "3afd55e3e5e3a193ee58adb717f63b0f44553849",
      "filename": "app/Payments/MGate.php",
      "status": "modified",
      "additions": 2,
      "deletions": 1,
      "changes": 3,
      "blob_url": "https://github.com/wyx2685/v2board/blob/90d1d98527c0c13a656b2fc10cfa5f3a234f6fd5/app%2FPayments%2FMGate.php",
      "raw_url": "https://github.com/wyx2685/v2board/raw/90d1d98527c0c13a656b2fc10cfa5f3a234f6fd5/app%2FPayments%2FMGate.php",
      "contents_url": "https://api.github.com/repos/wyx2685/v2board/contents/app%2FPayments%2FMGate.php?ref=90d1d98527c0c13a656b2fc10cfa5f3a234f6fd5",
      "patch": "@@ -91,7 +91,8 @@ public function notify($params)\n         ksort($params);\n         reset($params);\n         $str = http_build_query($params) . $this->config['mgate_app_secret'];\n-        if ($sign !== md5($str)) {\n+        $generateSignature = md5($str);\n+        if (!hash_equals($generateSignature, $sign)) {\n             return false;\n         }\n         return ["
    }
  ]
}
