[僅限PaaS]{class="badge informative" title="僅適用於雲端專案(Adobe管理的PaaS基礎結構)和內部部署專案的Adobe Commerce 。"}

ACSD-51846:內部錯誤,因為REST API裝載層級未驗證

ACSD-51846修補程式修正了「內部錯誤」發生的問題,因為所有層級的REST API裝載皆未驗證。 安裝Quality Patches Tool (QPT) 1.1.36時,即可使用此修補程式。 修補程式ID為ACSD-51846。 請注意,問題已在Adobe Commerce 2.4.7中修正。

受影響的產品和版本

已為Adobe Commerce版本建立修補程式:

  • Adobe Commerce (所有部署方法) 2.4.5-p2

與Adobe Commerce版本相容:

  • Adobe Commerce (所有部署方法) 2.4.3-p2 - 2.4.5-p4
NOTE
此修補程式可能適用於發行版本為Quality Patches Tool的其他版本。 若要檢查修補程式是否與您的Adobe Commerce版本相容,請將magento/quality-patches套件更新至最新版本,並在Quality Patches Tool上檢查相容性:搜尋修補程式頁面。 使用修補程式ID作為搜尋關鍵字,以尋找修補程式。

問題

發生「內部錯誤」,因為所有層級的REST API承載均未驗證。

要再現的步驟

  1. 將產品新增至客戶的購物車。
  2. 使用錯誤的屬性「REST APIstreet」將rest/V1/carts/mine/estimate-shipping-methods要求傳送給​ ",結尾有點。
 {
    "address": {
         "street.": [
             "\uc11c\uc6b8 \uac15\ubd81\uad6c \ud55c\ucc9c\ub85c166\uae38 2 (-\uc11c\uc6b8 \uac15\ubd81\uad6c \uc218\uc720\ub3d9 269-36)"
         ],
         "city": "pune",
         "region": null,
         "country_id": "IN",
         "postcode": "411015",
         "customer_id": "2",
         "firstname": "test",
         "lastname": "test",
         "middlename": null,
         "prefix": null,
         "suffix": null,
         "vat_id": null,
         "company": null,
         "telephone": "00000000000",
         "fax": null,
         "custom_attributes": []
     }
 }

預期結果

端點應該驗證引數,並傳回400 status code和特定的錯誤訊息。 範例:

report.CRITICAL: LogicException: Property "Street." does not have accessor method "getStreet." in class "Magento\Quote\Api\Data\AddressInterface". in vendor/magento/framework/Reflection/NameFinder.php:103

實際結果

端點未驗證錯誤的引數,並傳回500 status code錯誤。

套用修補程式

若要套用個別修補程式,請根據您的部署方法使用下列連結:

相關閱讀

若要進一步瞭解Quality Patches Tool,請參閱:

如需QPT中其他修補程式的詳細資訊,請參閱Quality Patches Tool指南中的:搜尋修補程式Quality Patches Tool。

recommendation-more-help
c2d96e17-5179-455c-ad3a-e1697bb4e8c3