Insecure inherited permissions
ID |
scala.perm.scala_perm_rule_dangerouspermissions |
Severity |
low |
Remediation Complexity |
trivial |
Remediation Risk |
low |
Remediation Effort |
low |
Resource |
Perm |
Language |
Scala |
Rationale
Do not grant dangerous combinations of permissions.
The following code illustrates a vulnerable pattern detected by this rule:
class SandboxPolicy extends Policy {
def grantReflection(source: CodeSource): Unit = {
val granted: PermissionCollection = super.getPermissions(source)
// VULNERABLE: Insecure inherited permissions
granted.add(new ReflectPermission("suppressAccessChecks"))
}
// Constructing the permission without granting it is the control.
def describeWithoutGranting(source: CodeSource): Unit = {
val permission = new ReflectPermission("suppressAccessChecks")
val listed = new Array[ReflectPermission](1)
listed(0) = permission
}
}
Remediation
Follow secure coding practices and review the references below for detailed remediation guidance.
References
-
OWASP Top 10 2025 - A01 : Broken Access Control.