Skip to content
Memory corruption Advisory Advanced CVE-2024-9957

Use after free in UI (CVE-2024-9957)

A use-after-free exists in Chrome's iOS price-tracking UI because the mediator holds a raw pointer to the WebState without observing its lifetime. If the WebState is destroyed while the price notifications view is still open, tapping an item calls through the dangling pointer and can crash or corrupt memory.

lime Follow

Originally disclosed on Chrome VRP

Bounty$5,000 Medium View original
  • Fix shipped in 2 months

Steps to reproduce the problem

repro:

  1. apply patch
  2. host poc8.html and navigate to https://www.baidu.com
  3. click ... and click Price Track feature. wait site close then choice item.

Problem Description

  1. As a property of PriceNotificationsPriceTrackingMediator, webstate is not monitored, so if webstate is destroyed but this member is called, UAF will occur.
OBJC
@interface PriceNotificationsPriceTrackingMediator () {
  // The service responsible for fetching a product's image data.
  std::unique_ptr<image_fetcher::ImageDataFetcher> _imageFetcher;
}
// The service responsible for interacting with commerce's price data
// infrastructure.
@property(nonatomic, assign) commerce::ShoppingService* shoppingService;
// The service responsible for managing bookmarks.
@property(nonatomic, readonly) bookmarks::BookmarkModel* bookmarkModel;
// The current browser state's webstate.
@property(nonatomic, assign) web::WebState* webState; // 
// The product data for the product contained on the site the user is currently
// viewing.
@property(nonatomic, assign) std::optional<commerce::ProductInfo>
    currentSiteProductInfo;
// The service responsible for updating the user's chrome-level push
// notification permissions for Price Tracking.
@property(nonatomic, assign) PushNotificationService* pushNotificationService;

@end
  1. There is a good example in it. PriceNotificationsTableViewController is created in the start of PriceNotificationsViewCoordinator, and then calls presentViewController to display the view.
OBJC
- (void)start {
  self.tableViewController = [[PriceNotificationsTableViewController alloc]
      initWithStyle:ChromeTableViewStyle()];
  [...]
  self.navigationController = [[TableViewNavigationController alloc]
      initWithTable:self.tableViewController];

  [...]
  [self.baseViewController presentViewController:self.navigationController
                                        animated:YES
                                      completion:nil];

  [super start];
}
  1. We can call navigateToWebpageForURL with the following calling path, and the same is true for navigateToBookmarks.
    [PriceNotificationsPriceTrackingMediator navigateToWebpageForURL:disposition:]
    [PriceNotificationsPriceTrackingMediator navigateToWebpageForItem:]
    [PriceNotificationsTableViewController tableView:performPrimaryActionForRowAtIndexPath:]
  1. However, webState is called in navigateToWebpageForURL. The webstate here is likely to be released, so it will cause UAF.
OBJC
- (void)navigateToWebpageForURL:(const GURL&)URL
                    disposition:(WindowOpenDisposition)disposition {
  self.webState->OpenURL(web::WebState::OpenURLParams(   //<--
      URL, web::Referrer(), disposition, ui::PAGE_TRANSITION_GENERATED,
      /*is_renderer_initiated=*/false));
}
-------------------
- (void)navigateToBookmarks {
  [self.handler hidePriceNotifications];
  GURL URL = _webState->GetLastCommittedURL();
  [self.bookmarksHandler openToExternalBookmark:URL];
}

bitset:

  1. navigateToBookmarks: introduced in https://source.chromium.org/chromium/chromium/src/+/204e33bd233f57ac11dd89d20e459baa45eec771 owner is danieltwhite@
  2. navigateToWebpageForURL: This vulnerability already existed as early as the navigateToWebpageForItem period. introduced in https://source.chromium.org/chromium/chromium/src/+/1ed6132349413aba22cccb482200758e8711e864 owner is danieltwhite@

so best owner is danieltwhite@ [0]. https://source.chromium.org/chromium/chromium/src/+/main:ios/chrome/browser/ui/price_notifications/price_notifications_price_tracking_mediator.mm;l=73 [1]. https://source.chromium.org/chromium/chromium/src/+/main:ios/chrome/browser/ui/price_notifications/price_notifications_view_coordinator.mm;l=116?q=self.navigationController%5C%20%3D&ss=chromium%2Fchromium%2Fsrc [3]. https://source.chromium.org/chromium/chromium/src/+/main:ios/chrome/browser/ui/price_notifications/price_notifications_price_tracking_mediator.mm;l=558?q=navigateToWebpageForURL&ss=chromium%2Fchromium%2Fsrc

why need patch: In order to enable the PriceTrack feature, because dev cannot compile gaia and use the account normally, please let me know if there is a way. Then added some traceability to the PriceItem. These do not affect the main logic.

Summary

heap-use-after-free on [PriceNotificationsPriceTrackingMediator navigateToWebpageForURL]

Custom Questions

Type of crash:

browser

Crash state:

see log

Additional Data

Category: Security
Chrome Channel: Not sure
Regression: N/A

The original report as published on the Chromium issue tracker, by lime(@limeSec_) and fmyy(@binary_fmyy) From TIANGONG Team of Legendsec at QI-ANXIN Group. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 5 min read.

Context

This report covers a use-after-free (UAF) in the iOS Chrome UI, specifically in the Price Tracking feature. The affected class is PriceNotificationsPriceTrackingMediator, which sits behind the price notifications UI and mediates between the table view controller that lists tracked products and the underlying browser state, shopping service, bookmark model and push notification service.

The bug was reported through the Chrome VRP and disclosed on 15 October 2024 as CVE-2024-9957. The platform records the severity as medium, the weakness as use after free, the asset as UI, and a bounty of 5000.00 USD. The researchers credited are lime (@limeSec_) and fmyy (@binary_fmyy) from the TIANGONG Team of Legendsec at QI-ANXIN Group.

The crash state given in the report is:

Text
heap-use-after-free on [PriceNotificationsPriceTrackingMediator navigateToWebpageForURL]

Setup

The reproduction needs a patched build. The report states that a patch has to be applied first, and explains why: the PriceTrack feature has to be enabled, because a developer cannot compile gaia and use the account normally. The author also added some traceability to the PriceItem, and notes that these changes do not affect the main logic.

The reproduction also needs a page hosted locally, poc8.html, and a navigation to https://www.baidu.com. The Chrome channel is listed as "Not sure" and regression as N/A. No specific Chrome version is given.

Finding it

The starting observation is about ownership. As a property of PriceNotificationsPriceTrackingMediator, the web state is not monitored. If the webState is destroyed while the mediator still holds a reference to it and a member function is later called, a use-after-free occurs.

The interface declaration in the report shows the relevant members:

OBJC
@interface PriceNotificationsPriceTrackingMediator () {
  // The service responsible for fetching a product's image data.
  std::unique_ptr<image_fetcher::ImageDataFetcher> _imageFetcher;
}
// The service responsible for interacting with commerce's price data
// infrastructure.
@property(nonatomic, assign) commerce::ShoppingService* shoppingService;
// The service responsible for managing bookmarks.
@property(nonatomic, readonly) bookmarks::BookmarkModel* bookmarkModel;
// The current browser state's webstate.
@property(nonatomic, assign) web::WebState* webState; //
// The product data for the product contained on the site the user is currently
// viewing.
@property(nonatomic, assign) std::optional<commerce::ProductInfo>
    currentSiteProductInfo;
// The service responsible for updating the user's chrome-level push
// notification permissions for Price Tracking.
@property(nonatomic, assign) PushNotificationService* pushNotificationService;

@end

The webState property is declared assign, so the mediator does not own the web state and nothing in this declaration ties its lifetime to the mediator's.

The report points to PriceNotificationsTableViewController as a good example. It is created at the start of PriceNotificationsViewCoordinator, and the coordinator then calls presentViewController to display the view:

OBJC
- (void)start {
  self.tableViewController = [[PriceNotificationsTableViewController alloc]
      initWithStyle:ChromeTableViewStyle()];
  [...]
  self.navigationController = [[TableViewNavigationController alloc]
      initWithTable:self.tableViewController];

  [...]
  [self.baseViewController presentViewController:self.navigationController
                                        animated:YES
                                      completion:nil];

  [super start];
}

Exploitation

Step 1: apply the patch

The build has to be patched to enable the PriceTrack feature, as described in Setup. The report does not include the patch itself.

Step 2: host the proof of concept and navigate

Host poc8.html and navigate to https://www.baidu.com.

Step 3: open Price Track and select an item

Click the entry point and click the Price Track feature. Wait for the site to close, then choose an item.

Choosing the item reaches the table view controller's primary action handler, which calls into the mediator. The report gives the calling path, and states that the same is true for navigateToBookmarks:

Text
    [PriceNotificationsPriceTrackingMediator navigateToWebpageForURL:disposition:]
    [PriceNotificationsPriceTrackingMediator navigateToWebpageForItem:]
    [PriceNotificationsTableViewController tableView:performPrimaryActionForRowAtIndexPath:]

Step 4: the mediator dereferences the stale web state

webState is called in navigateToWebpageForURL. The web state at that point is likely to have been released, so the call causes a UAF:

OBJC
- (void)navigateToWebpageForURL:(const GURL&)URL
                    disposition:(WindowOpenDisposition)disposition {
  self.webState->OpenURL(web::WebState::OpenURLParams(   //<--
      URL, web::Referrer(), disposition, ui::PAGE_TRANSITION_GENERATED,
      /*is_renderer_initiated=*/false));
}
-------------------
- (void)navigateToBookmarks {
  [self.handler hidePriceNotifications];
  GURL URL = _webState->GetLastCommittedURL();
  [self.bookmarksHandler openToExternalBookmark:URL];
}

Both functions dereference the web state: navigateToWebpageForURL calls OpenURL on self.webState, and navigateToBookmarks calls GetLastCommittedURL on _webState. The crash state recorded in the report is the heap-use-after-free on navigateToWebpageForURL.

Root cause

The mediator holds the web state as an assign property and does not monitor it. When the web state is destroyed, the mediator's pointer is left dangling, and the next call that goes through it, such as navigateToWebpageForURL or navigateToBookmarks, dereferences freed memory. The report frames this as the web state not being monitored.

The report also traces the code history. navigateToBookmarks was introduced in commit [redacted], owned by danieltwhite@. navigateToWebpageForURL already existed as early as the navigateToWebpageForItem period, introduced in commit [redacted], also owned by danieltwhite@. The report concludes that the best owner is danieltwhite@.

The source references given are:

Text
[0]. https://source.chromium.org/chromium/chromium/src/+/main:ios/chrome/browser/ui/price_notifications/price_notifications_price_tracking_mediator.mm;l=73
[1]. https://source.chromium.org/chromium/chromium/src/+/main:ios/chrome/browser/ui/price_notifications/price_notifications_view_coordinator.mm;l=116?q=self.navigationController%5C%20%3D&ss=chromium%2Fchromium%2Fsrc
[3]. https://source.chromium.org/chromium/chromium/src/+/main:ios/chrome/browser/ui/price_notifications/price_notifications_price_tracking_mediator.mm;l=558?q=navigateToWebpageForURL&ss=chromium%2Fchromium%2Fsrc

Impact

The crash state recorded in the report is a heap-use-after-free on navigateToWebpageForURL, and the crash type is recorded as browser. The crash type is recorded as browser. The report says the web state is likely to have been released when navigateToWebpageForURL is called. The report does not describe exploitation beyond the memory-safety crash, and the platform rates the severity as medium.

Fix

The report does not describe a fix. It identifies the missing lifetime monitoring of the web state as the cause and points to the commits and owners responsible for the affected functions.

Variants to test

  1. Other assign properties on the same mediator, such as shoppingService, bookmarkModel and pushNotificationService: check whether any of them can outlive their owner and be dereferenced after destruction. A positive result is a crash or sanitizer report when the owning service is torn down and the mediator is then used.
  2. The navigateToBookmarks path: the report states the same calling path applies. Trigger it after the web state is gone and look for a heap-use-after-free on GetLastCommittedURL.
  3. Other coordinators that create a table view controller and present it, following the PriceNotificationsViewCoordinator pattern: check whether the presented controller or its mediator keeps a raw pointer to a web state that can be destroyed while the UI is still alive. A positive result is a use-after-free when the user acts on the still-presented UI after the underlying page or web state has closed.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 15 min read.

What happened, in plain words

Chrome on iPhone and iPad has a feature called Price Tracking. It lets you keep an eye on the price of a product you are looking at in the browser, and it shows the products you follow in a list. The screen that shows that list is built from several pieces of software that talk to each other. One of those pieces is called PriceNotificationsPriceTrackingMediator. A mediator, in software, is a middleman: it takes a request from one part of the app (here, the list on screen) and passes it to another part (here, the browser itself, which knows which web page you are on).

The bug is that this middleman keeps a note of which web page you are on, but it never checks whether that page still exists. If the page is closed and thrown away by the app, the middleman still holds its old note. When you then tap something in the price list, the middleman tries to use the note to reach the page, and the page is no longer there. The app is now reading memory that has already been freed and may have been reused for something else. This kind of mistake is called a use-after-free, often shortened to UAF.

A simple comparison: imagine a receptionist who writes down the room number of a guest. The guest checks out and the room is given to someone else. If the receptionist later walks into that room expecting the original guest, they are acting on stale information. Nothing stops them, but what they find is not what they expect. In a computer, that can crash the app.

The report was sent through the Chrome VRP, Google's Vulnerability Reward Program, which pays people who find and report security bugs in Chrome. It was disclosed on 15 October 2024 as CVE-2024-9957. A CVE is a public catalogue number given to a known security flaw so that everyone can refer to the same thing. The platform records the severity as medium, the weakness as use after free, the asset as UI (the part of the product affected is the user interface), and a bounty of 5000.00 USD. The researchers credited are lime (@limeSec_) and fmyy (@binary_fmyy) from the TIANGONG Team of Legendsec at QI-ANXIN Group.

The crash state given in the report is:

Text
heap-use-after-free on [PriceNotificationsPriceTrackingMediator navigateToWebpageForURL]

That line is the short label of the crash. "Heap-use-after-free" means the program used memory from the heap after freeing it. The heap is the pool of memory a program borrows at runtime for objects it creates while running, as opposed to memory reserved in advance. The part in square brackets names the function where the bad access happened: navigateToWebpageForURL, a method on the mediator class.

Setup

Before the bug can be seen, the app has to be built in a special way. The report says a patch has to be applied first, and explains why: the PriceTrack feature has to be enabled, because a developer cannot compile gaia and use the account normally. Gaia is Google's account and sign-in system; without a working account setup, the feature that depends on being signed in cannot be reached in a normal developer build. The author also added some traceability to the PriceItem, meaning extra logging or markers so the item can be followed through the code, and notes that these changes do not affect the main logic. In other words, the patch is there to make the feature reachable and observable, not to create the bug.

The reproduction also needs a page hosted locally, poc8.html, and a navigation to https://www.baidu.com. "Hosted locally" means the file is served from the tester's own machine, for example by a small web server running on the same computer, so the tester controls exactly what the page contains. A proof of concept, or PoC, is a minimal example that demonstrates a bug. The Chrome channel is listed as "Not sure" and regression as N/A. No specific Chrome version is given.

Finding it

The starting observation is about ownership. In programming, every object has a lifetime: it is created, it is used, and eventually it is destroyed and its memory is released. Ownership means knowing who is responsible for that object and for deciding when it dies. As a property of PriceNotificationsPriceTrackingMediator, the web state is not monitored. A property is a value attached to an object in the code. The web state is the app's internal representation of a web page: the thing that knows the address, the history and the content of the tab. If the webState is destroyed while the mediator still holds a reference to it and a member function is later called, a use-after-free occurs. A reference here is just a stored address pointing at the object; it does not keep the object alive by itself.

The interface declaration in the report shows the relevant members:

OBJC
@interface PriceNotificationsPriceTrackingMediator () {
  // The service responsible for fetching a product's image data.
  std::unique_ptr<image_fetcher::ImageDataFetcher> _imageFetcher;
}
// The service responsible for interacting with commerce's price data
// infrastructure.
@property(nonatomic, assign) commerce::ShoppingService* shoppingService;
// The service responsible for managing bookmarks.
@property(nonatomic, readonly) bookmarks::BookmarkModel* bookmarkModel;
// The current browser state's webstate.
@property(nonatomic, assign) web::WebState* webState; //
// The product data for the product contained on the site the user is currently
// viewing.
@property(nonatomic, assign) std::optional<commerce::ProductInfo>
    currentSiteProductInfo;
// The service responsible for updating the user's chrome-level push
// notification permissions for Price Tracking.
@property(nonatomic, assign) PushNotificationService* pushNotificationService;

@end

Line by line, in plain words:

  • @interface PriceNotificationsPriceTrackingMediator () starts the declaration of the class, the blueprint for the middleman object. The empty brackets mean this part of the declaration is private to the code that implements it.
  • std::unique_ptr<image_fetcher::ImageDataFetcher> _imageFetcher; is a member that downloads product images. std::unique_ptr is a C++ type that owns exactly one object and frees it automatically when the pointer goes away. This is the careful kind of pointer.
  • @property(nonatomic, assign) commerce::ShoppingService* shoppingService; is a pointer to the shopping service, the part of Chrome that deals with price data. assign is the key word: it means the property just stores the address and does not take ownership. If the shopping service is destroyed elsewhere, this pointer is left pointing at nothing valid.
  • @property(nonatomic, readonly) bookmarks::BookmarkModel* bookmarkModel; points at the bookmarks data. readonly means other code cannot replace the pointer, but it says nothing about whether the object it points to stays alive.
  • @property(nonatomic, assign) web::WebState* webState; is the pointer at the centre of the bug: the current web page. It is also assign, so the mediator does not own the page and nothing here ties the page's lifetime to the mediator's.
  • @property(nonatomic, assign) std::optional<commerce::ProductInfo> currentSiteProductInfo; holds the product information for the page being viewed. std::optional means the value may or may not be present.
  • @property(nonatomic, assign) PushNotificationService* pushNotificationService; points at the service that manages notification permissions for price tracking.
  • @end closes the declaration.

The webState property is declared assign, so the mediator does not own the web state and nothing in this declaration ties its lifetime to the mediator's. The same pattern applies to the other assign properties shown. The one member that is handled carefully, _imageFetcher, uses unique_ptr, which shows the contrast: the code knows how to express ownership, but the web state is not expressed that way.

The report points to PriceNotificationsTableViewController as a good example of the lifecycle problem. A table view controller is the object that draws a list on screen. It is created at the start of PriceNotificationsViewCoordinator, and the coordinator then calls presentViewController to display the view. A coordinator is a helper object whose job is to assemble a screen and show it. presentViewController is the standard iOS way of putting a new screen on top of the current one.

OBJC
- (void)start {
  self.tableViewController = [[PriceNotificationsTableViewController alloc]
      initWithStyle:ChromeTableViewStyle()];
  [...]
  self.navigationController = [[TableViewNavigationController alloc]
      initWithTable:self.tableViewController];

  [...]
  [self.baseViewController presentViewController:self.navigationController
                                        animated:YES
                                      completion:nil];

  [super start];
}

Line by line:

  • - (void)start { is the method that runs when the coordinator is asked to begin. void means it returns nothing.
  • self.tableViewController = [[PriceNotificationsTableViewController alloc] initWithStyle:ChromeTableViewStyle()]; creates the list screen and stores it. alloc allocates memory for a new object; initWithStyle: sets it up with Chrome's table style.
  • [...] is the report's shorthand for code left out because it is not relevant.
  • self.navigationController = [[TableViewNavigationController alloc] initWithTable:self.tableViewController]; wraps the list in a navigation controller, the standard iOS container that adds a title bar and back navigation.
  • [self.baseViewController presentViewController:self.navigationController animated:YES completion:nil]; puts the wrapped list on screen, with animation, and no completion action.
  • [super start]; calls the parent class's version of start, so the standard setup still happens.

Exploitation

Step 1: apply the patch

The build has to be patched to enable the PriceTrack feature, as described in Setup. The report does not include the patch itself.

Step 2: host the proof of concept and navigate

Host poc8.html and navigate to https://www.baidu.com.

Step 3: open Price Track and select an item

Click the entry point and click the Price Track feature. Wait for the site to close, then choose an item. Waiting for the site to close is the important part: the report says the web state is likely to have been released by then. Choosing an item afterwards is what makes the mediator use that pointer.

Choosing the item reaches the table view controller's primary action handler, which calls into the mediator. The primary action is what happens when you tap a row, as opposed to selecting it or swiping it. The report gives the calling path, and states that the same is true for navigateToBookmarks:

Text
    [PriceNotificationsPriceTrackingMediator navigateToWebpageForURL:disposition:]
    [PriceNotificationsPriceTrackingMediator navigateToWebpageForItem:]
    [PriceNotificationsTableViewController tableView:performPrimaryActionForRowAtIndexPath:]

Read from the bottom up, because that is the order the calls happen in:

  1. tableView:performPrimaryActionForRowAtIndexPath: is the list telling its controller that the user tapped a particular row. indexPath is the row's position in the list.
  2. navigateToWebpageForItem: is the mediator being asked to open the page for that item.
  3. navigateToWebpageForURL:disposition: is the mediator doing the actual navigation. disposition says how the page should open, for example in the same tab or a new one.

Step 4: the mediator dereferences the stale web state

webState is called in navigateToWebpageForURL. The web state at that point is likely to have been released, so the call causes a UAF. "Dereference" means following a pointer to reach the object it points at; if the object is gone, the dereference touches freed memory.

OBJC
- (void)navigateToWebpageForURL:(const GURL&)URL
                    disposition:(WindowOpenDisposition)disposition {
  self.webState->OpenURL(web::WebState::OpenURLParams(   //<--
      URL, web::Referrer(), disposition, ui::PAGE_TRANSITION_GENERATED,
      /*is_renderer_initiated=*/false));
}
-------------------
- (void)navigateToBookmarks {
  [self.handler hidePriceNotifications];
  GURL URL = _webState->GetLastCommittedURL();
  [self.bookmarksHandler openToExternalBookmark:URL];
}

Line by line for the first function:

  • - (void)navigateToWebpageForURL:(const GURL&)URL disposition:(WindowOpenDisposition)disposition { declares a method that takes a URL and a disposition. GURL is Chrome's URL type; const GURL& passes it by reference without copying.
  • self.webState->OpenURL(...) is the dangerous line, marked with the //<-- comment. It follows the stored pointer to the web state and asks it to open a URL. If the web state has been freed, this is the use-after-free.
  • web::WebState::OpenURLParams(URL, web::Referrer(), disposition, ui::PAGE_TRANSITION_GENERATED, /*is_renderer_initiated=*/false) builds the parameters for the navigation: the target URL, the referrer (where the navigation came from), the disposition, the transition type, and a flag saying the navigation was not started by the page's own code.
  • The closing } ends the method.

Line by line for the second function:

  • - (void)navigateToBookmarks { declares a method that opens the bookmarks view.
  • [self.handler hidePriceNotifications]; asks the handler to hide the price notifications UI first.
  • GURL URL = _webState->GetLastCommittedURL(); follows the web state pointer to get the last URL the page committed to. This is the same stale-pointer problem in a second place.
  • [self.bookmarksHandler openToExternalBookmark:URL]; passes that URL to the bookmarks handler so it can open the bookmark.

Both functions dereference the web state: navigateToWebpageForURL calls OpenURL on self.webState, and navigateToBookmarks calls GetLastCommittedURL on _webState. The crash state recorded in the report is the heap-use-after-free on navigateToWebpageForURL.

Root cause

The mediator holds the web state as an assign property and does not monitor it. When the web state is destroyed, the mediator's pointer is left dangling, and the next call that goes through it, such as navigateToWebpageForURL or navigateToBookmarks, dereferences freed memory. The report frames this as the web state not being monitored, so destruction of the web state is not reflected in the mediator. A dangling pointer is a pointer that still holds an address after the object at that address has been freed; the address is not wrong, but what lives there is no longer the object you expect.

The report also traces the code history. navigateToBookmarks was introduced in commit [redacted], owned by danieltwhite@. A commit is a recorded change to the source code, identified by a long hash. navigateToWebpageForURL already existed as early as the navigateToWebpageForItem period, introduced in commit [redacted], also owned by danieltwhite@. The report concludes that the best owner is danieltwhite@. In a bug report, naming the owner means pointing to the person who wrote or last changed the code, so the fix can be routed to them.

The source references given are:

Text
[0]. https://source.chromium.org/chromium/chromium/src/+/main:ios/chrome/browser/ui/price_notifications/price_notifications_price_tracking_mediator.mm;l=73
[1]. https://source.chromium.org/chromium/chromium/src/+/main:ios/chrome/browser/ui/price_notifications/price_notifications_view_coordinator.mm;l=116?q=self.navigationController%5C%20%3D&ss=chromium%2Fchromium%2Fsrc
[3]. https://source.chromium.org/chromium/chromium/src/+/main:ios/chrome/browser/ui/price_notifications/price_notifications_price_tracking_mediator.mm;l=558?q=navigateToWebpageForURL&ss=chromium%2Fchromium%2Fsrc

These are links into Chromium's public source browser. Each one points at a file and a line number: the mediator implementation at line 73, the coordinator at line 116, and the mediator again at line 558, which is where navigateToWebpageForURL lives. The ?q= part is a search query used to highlight the matching text on the page.

Impact

The crash type is recorded as browser. The browser process is the main program that runs Chrome and coordinates everything. The crash type is recorded as browser. The report says the web state is likely to have been released when navigateToWebpageForURL is called. The report does not describe exploitation beyond the memory-safety crash, and the platform rates the severity as medium.

Fix

The report does not describe a fix. It identifies the missing lifetime monitoring of the web state as the cause and points to the commits and owners responsible for the affected functions.

Variants to test

  1. Other assign properties on the same mediator, such as shoppingService, bookmarkModel and pushNotificationService: check whether any of them can outlive their owner and be dereferenced after destruction. A positive result is a crash or sanitizer report when the owning service is torn down and the mediator is then used. A sanitizer is a tool built into a test build that watches memory use and reports mistakes like this one.
  2. The navigateToBookmarks path: the report states the same calling path applies. Trigger it after the web state is gone and look for a heap-use-after-free on GetLastCommittedURL.
  3. Other coordinators that create a table view controller and present it, following the PriceNotificationsViewCoordinator pattern: check whether the presented controller or its mediator keeps a raw pointer to a web state that can be destroyed while the UI is still alive. A raw pointer is one that does not own or track its target. A positive result is a use-after-free when the user acts on the still-presented UI after the underlying page or web state has closed.

Glossary

  • API: a defined way for one piece of software to ask another piece to do something, like a menu of allowed requests.
  • assign: a property setting in Objective-C that stores a pointer without taking ownership of the object, so the object can be freed while the pointer remains.
  • Bounty: money paid by a company to someone who reports a valid security bug.
  • Browser process: the main Chrome program that coordinates tabs, windows and features; separate from the processes that render individual pages.
  • Commit: a recorded change to source code, identified by a hash.
  • Coordinator: a helper object that assembles a screen and presents it.
  • CVE: a public catalogue number for a known security vulnerability.
  • Dangling pointer: a pointer that still holds an address after the object there has been freed.
  • Dereference: following a pointer to reach the object it points at.
  • Disposition: in Chrome, how a navigation should open, for example in the same tab or a new one.
  • Gaia: Google's account and sign-in system.
  • GURL: Chrome's type for a URL.
  • Heap: the pool of memory a program borrows at runtime for objects it creates while running.
  • Heap-use-after-free: using memory from the heap after it has been freed.
  • Index path: the position of a row in a list.
  • Mediator: a middleman object that passes requests between two other parts of a program.
  • Member function: a function that belongs to a class and operates on its objects.
  • Navigation controller: the standard iOS container that adds a title bar and back navigation around a screen.
  • Objective-C: the programming language used for much of Apple's software, including Chrome on iOS.
  • Patch: a small change applied to source code before building.
  • Pointer: a value that holds the memory address of an object.
  • PoC (proof of concept): a minimal example that demonstrates a bug.
  • Price Tracking: the Chrome feature that lets a user follow the price of a product and lists tracked products.
  • Primary action: what happens when a user taps a row in a list, as opposed to selecting or swiping it.
  • Property: a value attached to an object in the code.
  • Raw pointer: a pointer that does not own or track the object it points at.
  • Reference: a stored address pointing at an object; it does not by itself keep the object alive.
  • Referrer: the page or context a navigation came from.
  • Regression: a bug that did not exist in an earlier version and was introduced by a later change.
  • Sanitizer: a tool in a test build that watches memory use and reports mistakes.
  • Severity: a rating of how serious a bug is.
  • Table view controller: the iOS object that draws and manages a list on screen.
  • unique_ptr: a C++ pointer type that owns exactly one object and frees it automatically.
  • Use-after-free (UAF): using an object after it has been destroyed and its memory freed.
  • VRP (Vulnerability Reward Program): a programme that pays researchers for reporting security bugs.
  • Web state: the app's internal representation of a web page, including its address and history.
  • WebState: the Chrome class that implements the web state.

More by lime

View all

4 more disclosed reports, best first.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.