Skip to content
Threat Feed
high threat exploited

Unauthenticated Administrative Access in Semantic MediaWiki smwtask API

The Semantic MediaWiki smwtask API module fails to enforce authorization, enabling unauthenticated remote attackers to perform sensitive information disclosure, queue administrative maintenance jobs, and manipulate stored semantic data.

What's new

  • 1. added coverage for Semantic MediaWiki (3.1.0 - 7.0.0) Sep 18, 19:52 via ghsa

Semantic MediaWiki versions 3.0.0 through 7.2.1 contain a critical authorization vulnerability in the smwtask API module. The module implements a needsToken('csrf') check, but because MediaWiki provides a fixed, public CSRF token (+\) to anonymous users, this check fails to prevent unauthenticated access. Consequently, an attacker can invoke administrative tasks that are otherwise restricted to users with the smw-admin right via the Special:SMWAdmin web interface. The vulnerability allows attackers to query internal database statistics, enumerate object IDs, inject arbitrary maintenance jobs (such as fulltext search rebuilds or entity disposal), and force synchronous job execution, leading to both information disclosure and potential data integrity loss.

Attack Chain

  1. Attacker sends a request to api.php?action=query&meta=tokens&type=csrf to retrieve the anonymous session CSRF token.
  2. The server responds with the default public token value +\.
  3. Attacker constructs an HTTP POST request to api.php?action=smwtask using the +\ token to satisfy the CSRF check.
  4. Attacker calls table-statistics via the task parameter to enumerate internal object-ID spaces and database metrics.
  5. Attacker calls insert-job to enqueue administrative tasks, such as smw.entityIdDisposer or smw.fulltextSearchTableRebuild, targeting specific wiki identifiers.
  6. Attacker calls run-joblist with a serialized parameters object to force synchronous execution of the injected maintenance jobs.
  7. The application executes the requested administrative jobs with the privileges of the system backend, resulting in unauthorized data modification or performance degradation.

Impact

Successful exploitation allows unauthenticated actors to bypass access controls intended for administrators. Observed consequences include unauthorized disclosure of database internal structures and statistics, resource exhaustion via forced synchronous job execution, and the modification or deletion of semantic data entities. The severity of the impact scales with the size of the wiki's semantic store and the criticality of the targeted maintenance operations.

Recommendation

Prioritize the immediate remediation of affected Semantic MediaWiki instances by upgrading to version 7.3.0 or later. If an immediate upgrade is not feasible, implement a hotfix in the site's LocalSettings.php to unregister the vulnerable API module:

$wgExtensionFunctions[] = static function () {
 unset( $GLOBALS['wgAPIModules']['smwtask'] );
};

Deploy detection rules to monitor for anomalous POST requests to the api.php endpoint containing action=smwtask and verify the identity of the requesting user.


Immediate actions

Upgrade Semantic MediaWiki to 7.3.0 or higher.

IT Operations 24h

Apply the LocalSettings.php patch to unset the smwtask API module if immediate upgrade is not possible.

IT Operations 4h

Threat Hunt

Search web logs for POST requests to /api.php with action=smwtask.

T1190 high high confidence hunt now

Data: webserver_access_logs

Mitigations

Disable smwtask module via PHP snippet in LocalSettings.php

immediate IT Operations

API authorization bypass

Detection coverage 1

Detect Unauthenticated Access to Semantic MediaWiki smwtask

high

Detects HTTP POST requests to the smwtask API module, which lacks proper authorization checks.

sigma tactics: initial_access techniques: T1190 sources: webserver

Detection queries are available on the platform. Get full rules →