- severity: High
- files:
shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/MetaDataServiceImpl.java:124-136
- description:
selectByIdListAndNamespaceId(ids, namespaceId) scopes the existence check by namespaceId, but the subsequent metaDataMapper.updateEnableBatch(ids, enabled) (line 132) is passed the raw ids with no namespaceId filter (verified: the mapper SQL at meta-data-sqlmap.xml:225 is WHERE id IN (...) with no namespace). If a caller in namespace A supplies ids = [id-in-A, id-in-B], the select returns only the A row (non-empty), so the method proceeds, and updateEnableBatch enables/disables the B row too.
- impact: A user scoped to one namespace can enable/disable metadata belonging to another namespace, breaking namespace isolation and potentially disabling traffic in unrelated namespaces.
- suggested_fix: Pass the filtered id list (
metaDataDoList.stream().map(MetaDataDO::getId)) to updateEnableBatch, or add a namespaceId overload of the mapper update.
- confidence: High
- related_existing: none. The baseline MetaData items cover other concerns; this is a cross-namespace mutation bug.
Identified during the 2026-08-02 deep re-scan; full list in docs/scan2-2026-08-02/00-consolidated-critical-high.md.
shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/MetaDataServiceImpl.java:124-136selectByIdListAndNamespaceId(ids, namespaceId)scopes the existence check bynamespaceId, but the subsequentmetaDataMapper.updateEnableBatch(ids, enabled)(line 132) is passed the rawidswith nonamespaceIdfilter (verified: the mapper SQL atmeta-data-sqlmap.xml:225isWHERE id IN (...)with no namespace). If a caller in namespace A suppliesids = [id-in-A, id-in-B], the select returns only the A row (non-empty), so the method proceeds, andupdateEnableBatchenables/disables the B row too.metaDataDoList.stream().map(MetaDataDO::getId)) toupdateEnableBatch, or add anamespaceIdoverload of the mapper update.Identified during the 2026-08-02 deep re-scan; full list in
docs/scan2-2026-08-02/00-consolidated-critical-high.md.