Is it safe?
As I understand JS code drived by Mozilla Rhino => JS code has full access to all services(example: java.lang.System.exit).
I can create a new page (example: /blabla/i-am-hidden-url) and write simple JS controller: java.lang.System.exit(0); (yesss. it work) If I make request to: /blabla/i-am-hidden-url server will shutdown. I think - AEM should block "dangerous"(not only java.lang.System.exit) API in JS. JS should only prepare/convert data before rendering.
Thank you