Open Social - Moderately critical - Access bypass - SA-CONTRIB-2025-014
Description
Missing authorization in Drupal Open Social allows unauthorized users to access restricted content via forceful browsing, affecting versions before 12.3.11 and 12.4.10.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Missing authorization in Drupal Open Social allows unauthorized users to access restricted content via forceful browsing, affecting versions before 12.3.11 and 12.4.10.
CVE-2025-31685 is a missing authorization vulnerability in the Open Social distribution for Drupal. The issue resides in the language access check within the OpenSocial\LanguageAccess class. When the language service is not invoked with a permission parameter, the original code would grant access without verifying user permissions, allowing unauthorized users to access restricted routes [1].
Exploitation is achieved through forceful browsing—an attacker can directly navigate to protected endpoints without proper authentication or permission checks. The vulnerability does not require any special prerequisites beyond network access to the site [1]. The fix, shown in two identical commits [2][3], retrieves the required permission from the route object and applies proper access control.
The impact is information disclosure and potential bypass of access controls, enabling unauthorized viewing of content that should be restricted (e.g., private groups or posts). This could lead to data exposure and violation of access policies.
Mitigation is available by updating Open Social to version 12.3.11 or 12.4.10, which include the corrected access logic [1][2][3]. Users on earlier versions should upgrade immediately. No workarounds are documented beyond applying the patch.
AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
goalgorilla/open_socialPackagist | < 12.3.11 | 12.3.11 |
goalgorilla/open_socialPackagist | >= 12.4.0, < 12.4.10 | 12.4.10 |
Affected products
2- Drupal/Open Socialv5Range: 0.0.0
Patches
252c531e156fbWhen language service is not being called make sure to use the route object
1 file changed · +15 −4
modules/custom/social_language/src/Access.php+15 −4 modified@@ -7,6 +7,7 @@ use Drupal\Core\Routing\Access\AccessInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Session\AccountInterface; +use Symfony\Component\Routing\Route; /** * Class Access. @@ -49,12 +50,22 @@ public function __construct(LanguageManagerInterface $language_manager) { */ public function access(RouteMatchInterface $route_match, AccountInterface $account, $permission = NULL) { if (count($this->languageManager->getLanguages()) > 1) { - if (!empty($permission)) { - return AccessResult::allowedIfHasPermission($account, $permission); + // If the permission is null the service was not called, + // and we should get it from the route object. + if (is_null($permission)) { + // Get route object. + $route = $route_match->getRouteObject(); + assert($route instanceof Route); + + // Get defined permission on _social_language_access. + $permission = $route->getRequirements()['_social_language_access']; } - else { - return AccessResult::allowed(); + + if (is_string($permission)) { + return AccessResult::allowedIfHasPermission($account, $permission); } + + return AccessResult::neutral(); } return AccessResult::forbidden();
6ebeed01c83dWhen language service is not being called make sure to use the route object
1 file changed · +15 −4
modules/custom/social_language/src/Access.php+15 −4 modified@@ -7,6 +7,7 @@ use Drupal\Core\Routing\Access\AccessInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Session\AccountInterface; +use Symfony\Component\Routing\Route; /** * Class Access. @@ -49,12 +50,22 @@ public function __construct(LanguageManagerInterface $language_manager) { */ public function access(RouteMatchInterface $route_match, AccountInterface $account, $permission = NULL) { if (count($this->languageManager->getLanguages()) > 1) { - if (!empty($permission)) { - return AccessResult::allowedIfHasPermission($account, $permission); + // If the permission is null the service was not called, + // and we should get it from the route object. + if (is_null($permission)) { + // Get route object. + $route = $route_match->getRouteObject(); + assert($route instanceof Route); + + // Get defined permission on _social_language_access. + $permission = $route->getRequirements()['_social_language_access']; } - else { - return AccessResult::allowed(); + + if (is_string($permission)) { + return AccessResult::allowedIfHasPermission($account, $permission); } + + return AccessResult::neutral(); } return AccessResult::forbidden();
Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5- github.com/advisories/GHSA-gf72-h4cp-wcm4ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2025-31685ghsaADVISORY
- github.com/goalgorilla/open_social/commit/52c531e156fb8653e47ab99df432c4fb9651f36eghsaWEB
- github.com/goalgorilla/open_social/commit/6ebeed01c83dc4947a5c3689bc33b4deca574473ghsaWEB
- www.drupal.org/sa-contrib-2025-014ghsaWEB
News mentions
0No linked articles in our index yet.