Security
This release fixes 12 security issues: 5 are published with CVE identifiers (requested) and 7 as GitHub Security Advisories only. This pre-release of the 21.x line merges the v20.19.3 security release, and ships Zend Framework 1 (shardj/zf1-future) 1.27.2, upgraded from 1.25.2 for an upstream SQL injection fix. The same fixes ship in v20.18.5.
Scores are CVSS 3.1. The most serious issue lets an administrator whose role is limited to product tags read the database and take over a full administrator account; another lets a role limited to exporting data take over customer accounts. Several let storefront visitors, including guests, pay less than the store charges: configurable product surcharges, tier prices, shipping charges and bundle quantities. If you give restricted admin or API roles to people you would not trust with full access, or sell configurable products with surcharges, upgrade first.
GHSA-9qmw-3wvr-72c4, the product attribute API SQL injection fixed in 20.18.4, 20.19.2 and 21.0.0-beta5, is rescored from Medium 4.9 to High 7.2 with this release because, as with GHSA-vjjr-cjx6-6rvg, the database read it gave a restricted API role reached administrator password-reset tokens, which were stored in clear until this release; no action is needed beyond upgrading.
Advisories with a CVE
| Advisory | Issue | Severity | CVE | Fixed in |
|---|---|---|---|---|
| GHSA-vjjr-cjx6-6rvg | SQL injection in the admin tag editor lets a Tags-only role read the database and take over an administrator account | High 7.2 | requested | 20.18.5, 20.19.3, 21.0.0-beta6 |
| GHSA-6j37-vwrg-4wjv | Customer export leaks password-reset tokens and confirmation keys; an Export-only role can take over customer accounts | Medium 6.5 | requested | 20.18.5, 20.19.3, 21.0.0-beta6 |
| GHSA-r3fg-pv6f-27r5 | Multishipping checkout gives tier prices for fewer units and reduces stock without ordering it | Medium 5.4 | requested | 20.18.5, 20.19.3, 21.0.0-beta6 |
| GHSA-crgh-j2hr-gcc9 | Orders keep a shipping charge calculated for another address, a smaller cart or an unavailable carrier | Medium 5.3 | requested | 20.18.5, 20.19.3, 21.0.0-beta6 |
| GHSA-ch6h-4phh-xwc5 | Guests can drop configurable product surcharges or repeat discounted custom option values when adding to the cart | Medium 5.3 | requested | 20.18.5, 20.19.3, 21.0.0-beta6 |
Advisories without a CVE
These are published so you can track them. Each one either needs a back-office account, depends on settings that are not the default, or has low impact.
| Advisory | Issue | Severity | Fixed in |
|---|---|---|---|
| GHSA-wxr3-w7hj-pccg | API and catalog roles plant stored XSS in the admin product editor through attribute set names and Fixed Product Tax rows (GHSA-qpch follow-up) | Medium 6.1 | 20.18.5, 20.19.3, 21.0.0-beta6 |
| GHSA-5h9r-hjpg-53m3 | get.php serves guest-uploaded custom option files despite the deny rule for media/custom_options
| Medium 4.7 | 20.18.5, 20.19.3, 21.0.0-beta6 |
| GHSA-3wcc-vr2g-rxx7 | Cart shipping estimate prints the session region id unescaped (cross-site scripting) | Medium 4.7 | 20.18.5, 20.19.3, 21.0.0-beta6 |
| GHSA-mvf8-5f8w-qx25 | Restricted roles still change other products' custom options and read newsletter subscribers (GHSA-wx5g and GHSA-4wh6 follow-up) | Low 3.8 | 20.18.5, 20.19.3, 21.0.0-beta6 |
| GHSA-j438-x735-h6j8 | Path traversal in product image paths lets a catalog or import role publish images from anywhere on disk | Low 3.8 | 20.18.5, 20.19.3, 21.0.0-beta6 |
| GHSA-wc36-ffvv-8924 | API product create can overwrite any product's stock item, and category update can move categories (GHSA-wx5g follow-up) | Low 3.8 | 20.18.5, 20.19.3, 21.0.0-beta6 |
| GHSA-89x4-39qp-mm98 | Guests can raise item quantities inside a fixed-price bundle from the cart without paying | Low 3.7 | 20.18.5, 20.19.3, 21.0.0-beta6 |
Zend Framework 1 update
shardj/zf1-future is upgraded to 1.27.2 (#5906), the upstream security release for SQL injection in Zend_Db_Select::order() and group(). All earlier zf1-future versions are affected. Core's own sort and group calls that relied on the old behaviour now pass Zend_Db_Expr (#5903, #5906, and #5917, without which sorting the admin Customers grid by Name fails). The upgrade changes behaviour for extensions: see Database queries below.
Behaviour changes and upgrade notes
Review these before you upgrade. Most need no action unless you run SOAP/XML-RPC integrations, extensions that build their own database queries, or customised cart and checkout code. Each advisory has the full list. Two effects are one-time: password-reset links issued before the upgrade stop working, and cart items that hold malformed option values or changed bundle quantities are repriced, corrected or blocked the next time the cart is loaded.
Password reset and exports
- Password-reset tokens for customers and administrators are stored hashed. The emailed link still carries the token; only its hash is kept in the database. Reset links issued before the upgrade stop working with "Your password reset link has expired.", and the customer or administrator requests a new one. Code that compares
rp_tokenfrom the database with a token must callvalidateResetPasswordLinkToken()on the customer or admin user model instead. Code that sends a reset email must first issue the token withchangeResetPasswordLinkToken()on the same model instance, as core does. - The customer export (System › Import/Export › Export) writes the columns the customer import accepts.
rp_token,rp_token_created_at,rp_customer_idandconfirmationare no longer exported or offered in the export filter; on a default installstore_idandpassword_created_atare also left out (_storestill names the store view).password_hashis still exported, so moving accounts by export and import works as before. Tools that readconfirmationfrom the export to tell pending accounts from confirmed ones need another source. The Dataflow customer export leaves out the same four attributes.
Checkout and cart
- Configurable products accept only whole-number option ids for their configurable attributes. Anything else is refused with "Please specify the product's option(s)."; values for other attributes are ignored. The selection and the variant surcharge are taken from the child product actually added. Cart items that already hold a malformed value are repriced from that child product, with its surcharge, at the next recalculation. Wishlist items that hold one are refused when moved to the cart until they are reconfigured.
- Custom options of every select type accept only whole-number ids of the option's own values, and checkbox and multiple-select options only distinct ones. Other values are refused with "Please specify the product required option" followed by the option's title. An unknown drop-down or radio value, which used to be accepted with a flag on the cart item, is now refused when the product is added. A cart item that already holds a repeated value is priced with that value once, marked "Some of the selected item options are not currently available." and cannot be checked out until it is removed or reconfigured.
- Bundle products. A buy request that names a selection of another bundle, or a selection under an option it does not belong to, is refused with "Please specify product option(s)."
- Integrations that add products to the cart through the API, the admin order editor or custom code must send option ids as plain integers. Storefront forms already do.
- Items inside bundle and configurable products. The cart update form (quantity and remove), cart item removal, the Ajax mini-cart update, item reconfiguration, "Move to wishlist" and the multishipping address step accept only top-level cart item ids. A child item id is ignored or refused with "Quote item is not found." (the mini-cart answers "Can not save item.", "Move to wishlist" "Requested cart item doesn't exist", the multishipping step "Please check shipping address information."). A child item's quantity is reset to the quantity its parent declares (the bundle selection quantity, or 1 for a configurable product) whenever it is set and whenever the cart is loaded, so carts that already hold a changed child quantity are corrected before totals are collected or an order is placed. Custom code that sets child quantities will see them overridden.
- Multiple-address checkout. The address step is refused, with the cart unchanged, if a row names an address that is not the customer's, names no address for an item that ships, names an item inside a bundle or configurable product, or has a negative or fractional quantity. The customer sees "Please specify a valid quantity for each item." or "Please check shipping address information." Before the orders are created, each cart item's quantity must equal the total assigned to addresses; otherwise the customer returns to the cart with "The quantities assigned to shipping addresses do not match the quantities in your cart. Please check them and try again." Stock templates are not affected; custom code that relied on bad rows being skipped now gets an error.
Shipping rates
- Shipping rates are requested again before an order is placed, in the one-page checkout, multishipping, PayPal Express and the cart API. Stores with live carrier rates make one extra rate request per order. Admin order creation and editing keep the method and price the admin chose.
- If the selected method is no longer offered or its price changed, the order is refused with "The selected shipping method is no longer available. Please select a shipping method again." or "The shipping cost of your order has changed. Please review the shipping method and place the order again." The new rates are saved, and the customer returns to the shipping method step (one-page checkout) or Shipping Information (multishipping). This also happens when a live carrier cannot be reached at that moment or its rate changed since the customer reviewed the order.
- A carrier shown as not applicable (Show Method if Not Applicable) can no longer be selected ("Invalid shipping method.") in the checkout, the cart estimate or multishipping, and an order with such a method is refused.
/usa/address/applyno longer changes the cart; with USPS address verification disabled it only answers "Address verification is disabled." The corrected address still reaches the cart when the customer continues the checkout step.Mage_Usa_Model_Shipping_Carrier_Usps_Address_Service::applyCorrectionToQuote()is kept for custom code and now requests new rates.- Shipping is recalculated for a customer's cart when they log in, whether or not a guest cart was merged into it.
- The cart shipping estimate keeps the region id as an integer in the quote and the session. A
region_idthat is not a positive number is treated as no region; estimates stored in sessions before the upgrade are cast when applied.
Media and get.php
get.phpno longer serves files undermedia/custom_options/, and never servesmedia/customer/,media/downloadable/ormedia/import/, even if a module adds them toallowed_resources. Customers and administrators keep downloading custom option files through the existing download links.- When database media storage is not in use,
get.phpreturns 404 for every request (before, only when its configuration cache was not fresh). The web server serves media files directly, so storefront images are unaffected. allowed_resourcesentries match whole path segments:catalogallowscatalog/...but no longercatalogfoo/..., and an empty entry allows nothing (before, it allowed every media path). Modules that add entries should list the exact directory name.- Product image paths. An image attribute value (
image,small_image,thumbnailor a custom one) or placeholder setting with a..segment or a NUL byte shows the placeholder image on the storefront. Saving such a value is refused withThe image file path of the "<code>" attribute is not valid.; a product that already holds one can still be saved from the admin while that value is unchanged. Symlinks insidemedia/catalog/productkeep working. - Product import skips an image name with
..or a NUL byte, or one that names no file insidemedia/import, and imports the row without it, as for a missing file before.sub/../x.jpg, which used to work, is now refused. Configurable swatches with such a file name, or a file outside the media directory, are not rendered, and a watermark setting that contains..is ignored.
Product editor and catalog APIs
- The attribute set name in the product editor heading is escaped, so
&,<and>show as text. Tags are stripped from a new or renamed attribute set, whether it is saved from the admin, the SOAP/XML-RPC API or extension code. A name that is empty without its tags, or is not text, is refused with "The attribute set name cannot be empty." or "The attribute set name is not valid." (an API fault). Existing names keep their tags until the set is renamed or saved in the set editor. - Fixed Product Tax rows. The
statemust be empty,*or a numeric region id, the website id a number and the country text. A product save with any other value is refused with "A Fixed Product Tax row has an invalid website, country or state." (an API fault). Rows stored before the upgrade are escaped when shown. Outside the admin form, changing the FPT rows of a product that still holds an invalid old row is refused until that row is corrected or removed. - Custom options. The option and option value models refuse an
option_idof another product and anoption_type_idof another option, from any caller including the APIupdatecalls:The custom option with ID "<id>" belongs to another product.orThe custom option value with ID "<id>" belongs to another option.Integrations that moved option values between products this way now get a fault. Value rows are saved only for select-type options (avalueslist on a text, file or date option is ignored), and for other types the API takes only the documentedadditional_fields(price, price type, SKU, maximum characters, file extensions, image size). saveOptions()clears the shared custom option rows after taking them, so code that saves several products in one process no longer carries one product's options over to the next (before, they were moved or copied to it).- Stock data. Every product save (API, REST, admin, Dataflow or custom code) ignores
item_id,product_idandstock_idinstock_data: a new product always gets a new stock item and an existing product saves its own. An extension that usedstock_data.stock_idto pick another stock can overrideMage_CatalogInventory_Model_Observer::$_stockDataRowKeys. Astock_datavalue that is not an array no longer causes an error. - Category API.
catalog_category.createandcatalog_category.updateignorepath,parent_id,levelandchildren_count;info()still returns them. An integration that moved categories by sendingpathtoupdate()now succeeds without moving anything and must callcatalog_category.move.
Admin roles
- The admin tag editor accepts only an existing store view in its
storeparameter. Any other value redirects to the tag grid with "Wrong tag was specified." - The newsletter template preview loads the subscriber named in the request only for users who hold Newsletter › Newsletter Subscribers. For others it renders with an empty subscriber.
Database queries (Zend Framework 1)
- A string passed to
Zend_Db_Select::order()orgroup()that looks like an SQL function call (RAND(),DATE(created_at),IF(...) DESC) now throwsZend_Db_Select_Exception. This includes the$orderargument ofZend_Db_TablefetchAll()andfetchRow(). Extensions must wrap the whole expression innew Zend_Db_Expr(...). Varien collectionsetOrder()andaddOrder()are not affected. Upstream'sZend_Db_Select::setStringExpressionsAllowed(true)restores the old conversion and the injection with it; use it only as a stop-gap for code that passes no user input. - EAV collection sorts on an attribute that is joined with its store and default values accept only
ASCorDESCas the direction; any other value sorts ascending.
Templates
- Template overrides. If your theme overrides any of these templates, apply the same changes. Storefront (base, and rwd where it has its own copy):
checkout/cart/shipping.phtml,checkout/onepage/billing.phtmlandshipping.phtml,customer/address/edit.phtml,customer/form/address.phtmlandregister.phtml,persistent/checkout/onepage/billing.phtml,persistent/customer/form/register.phtmland rwd'spaypal/express/review/address.phtmlprint the region id as an integer, and nothing when no region is set. Copies you have not updated stay safe: the cart estimate is fixed in the controller and the other templates receive integers. Admin:weee/renderer/tax.phtmlescapes Fixed Product Tax rows stored before the upgrade, so update an override of it;catalog/product/edit/price/tier.phtmlandgroup.phtmlprint website and customer group ids as integers.
If restricted admin roles have held Catalog › Tags, or System › Import/Export › Export or a Dataflow profile permission that runs a customer export, review who held them: these issues let such roles take over administrator or customer accounts. Check admin_user for unexpected password changes and new users, and rotate admin passwords and API keys. Delete old customer export files from var/export and wherever they were downloaded to, because they may contain reset tokens and confirmation keys. To look for orders placed through the pricing issues, see the Workarounds of GHSA-ch6h-4phh-xwc5 and GHSA-crgh-j2hr-gcc9.
Thanks
We thank every researcher who reported these issues through HackerOne. Each advisory names its reporters.
Changes
- Merges v20.19.3: the security fixes and the Zend Framework 1 update above, and the changes merged to
mainsince v20.19.2, including the newbin/openmageCLI (see the v20.19.3 notes).
Full Changelog: v21.0.0-beta5...v21.0.0-beta6