Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.8.3
-
Fix Version/s: None
-
Component/s: None
-
Labels:
-
Number of attachments :
Description
In several occurrences in the code, the system properties are accessed in this manner:
groovy.grape.Grape.java
private static boolean enableGrapes = Boolean.valueOf(System.getProperties().getProperty("groovy.grape.enable", "true"));
The use of System.getProperties() forces the use of this permission in the SecurityManager:
java.util.PropertyPermission "*" "read,write"
This is not really desired in security sensitive environments. It is not possible to use more fine-grained permission declaration like e.g.:
java.util.PropertyPermission "groovy.*" "read,write"
This problem could be easily avoided by accessing the properties in this manner:
private static boolean enableGrapes = Boolean.valueOf(System.getProperty("groovy.grape.enable", "true"));
Without the use of System.getProperties() it is not mandatory to set the dangerous write permission on all system properties and more fine-grained security permissions like in the example could be used.
I fixed the grape occurrences but there is one more in GroovyMain still outstanding that I am still investigating.