Files
Paweł Gronowski 0afb41ce19 plugin: Fix off-by-one in privilege validation
Fix an off-by-one error in isEqual() where the comparison loop started
at index 1 instead of 0, causing the first privilege (after sorting
alphabetically by name) to never be validated.

This allowed a malicious plugin to request different values for
whichever privilege sorts first — most notably "allow-all-devices",
which grants unrestricted rwm access to all host devices.

The bug also meant that plugins requesting exactly one privilege had
zero iterations of the comparison loop, bypassing validation entirely.

Also fix an existing test case ("diff-order-but-same-value") that only
passed due to the off-by-one bug, and add test cases for single-element
and first-sorted-element mismatches.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 99a095ecf0)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-03-25 13:09:14 +01:00
..
2025-06-13 08:26:56 +00:00
2025-05-30 15:59:15 +02:00
2025-05-30 15:59:15 +02:00
2025-05-30 15:59:15 +02:00
2025-05-30 15:59:15 +02:00