CVE-2021-32722 (published 2021-06-28T20:15Z)

GlobalNewFiles is a mediawiki extension. Versions prior to 48be7adb70568e20e961ea1cb70904454a671b1d are affected by an uncontrolled resource consumption vulnerability. A large amount of page moves within a short space of time could overwhelm Database servers due to improper handling of load balancing and a lack of an appropriate index. As a workaround, one may avoid use of the extension unless additional rate limit at the MediaWiki level or via PoolCounter / MySQL is enabled. A patch is available in version 48be7adb70568e20e961ea1cb70904454a671b1d.

Severity: MEDIUM
CVSS v2 base score: 4.0 (AV:N/AC:L/Au:S/C:N/I:N/A:P)
CVSS v3 base score: 6.5, MEDIUM (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H)

Weakness information:
cwe_id: CWE-400
cwe_name: Uncontrolled Resource Consumption
description: The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.
extended_description: 
            Limited resources include memory, file system storage, database connection pool entries, and CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the product, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.
            There are at least three distinct scenarios which can commonly lead to resource exhaustion:
               
                  Lack of throttling for the number of allocated resources
                  Losing all references to a resource before reaching the shutdown stage
                  Not closing/returning a resource after processing
               
            Resource exhaustion problems are often result due to an incorrect implementation of the following situations:
               
                  Error conditions and other exceptional circumstances.
                  Confusion over which part of the program is responsible for releasing the resource.
               
         
         

Fix information:
repo_url: https://github.com/miraheze/GlobalNewFiles
commit_details: repo_url: https://github.com/miraheze/GlobalNewFiles
author: Universal Omega
author_date: 2021-07-19 16:20:42-06:00
msg: Use PageMoveComplete hook (#17)
repository: repo_url: https://github.com/miraheze/GlobalNewFiles
repo_name: miraheze/GlobalNewFiles
repo_language: PHP
owner: miraheze
file_changes: filename: extension.json
change_type: ModificationType.MODIFY
diff: @@ -53,8 +53,8 @@
 		"FileDeleteComplete": [
 			"GlobalNewFilesHooks::onFileDeleteComplete"
 		],
-		"TitleMoveComplete": [
-			"GlobalNewFilesHooks::onTitleMoveComplete"
+		"PageMoveComplete": [
+			"GlobalNewFilesHooks::onPageMoveComplete"
 		],
 		"UploadComplete": [
 			"GlobalNewFilesHooks::onUploadComplete"

programming_language: Go
filename: GlobalNewFilesHooks.php
change_type: ModificationType.MODIFY
diff: @@ -19,10 +19,13 @@ class GlobalNewFilesHooks {
 		);
 	}
 
-	public static function onTitleMoveComplete( $title, $newTitle, $user, $oldid, $newid, $reason, $revision ) {
-		if ( $title->inNamespace( NS_FILE ) ) {
+	public static function onPageMoveComplete( $old, $new, $userIdentity, $pageid, $redirid, $reason, $revision ) {
+		$oldTitle = Title::newFromLinkTarget( $old );
+		$newTitle = Title::newFromLinkTarget( $new );
+
+		if ( $oldTitle->inNamespace( NS_FILE ) ) {
 			JobQueueGroup::singleton()->push(
-				new GlobalNewFilesMoveJob( [ 'oldtitle' => $title, 'newtitle' => $newTitle ] )
+				new GlobalNewFilesMoveJob( [ 'oldtitle' => $oldTitle, 'newtitle' => $newTitle ] )
 			);
 		}
 	}

programming_language: PHP