Skip to content

Fix/effective capabilities union - #2357

Closed
HitanshiThakar wants to merge 5 commits into
utksh1:mainfrom
HitanshiThakar:fix/effective-capabilities-union
Closed

Fix/effective capabilities union#2357
HitanshiThakar wants to merge 5 commits into
utksh1:mainfrom
HitanshiThakar:fix/effective-capabilities-union

Conversation

@HitanshiThakar

Copy link
Copy Markdown
Collaborator

Description

This change fixes a security issue in effective_capabilities where explicitly declared plugin capabilities could override capabilities implied by a plugin's safety level.

Changes include:

Update effective_capabilities to return the union of declared capabilities and safety-level implied capabilities.
Prevent plugins from downgrading their effective capabilities by declaring a narrower capability set.
Add regression coverage to verify that implied safety capabilities are always preserved when explicit capabilities are present.
Preserve existing behavior for plugins without explicitly declared capabilities.

Related Issues

Closes #1753

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

python -m pytest testing/backend/unit/test_capabilities_effective.py testing/backend/unit/test_capabilities.py testing/backend/unit/test_plugin_capabilities_inventory.py

Checklist

  • My code follows the code style of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.

@HitanshiThakar
HitanshiThakar deleted the fix/effective-capabilities-union branch July 31, 2026 12:34
@utksh1 utksh1 added the gssoc:invalid Admin validation: invalid for GSSoC scoring label Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:invalid Admin validation: invalid for GSSoC scoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[#7] Explicit capabilities can downgrade enforcement (safety escape hatch)

2 participants