Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 4f5a60b

Browse files
committed
docs($parse): formatting, link to security docs
1 parent e593939 commit 4f5a60b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/ng/parse.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var $parseMinErr = minErr('$parse');
55
// Sandboxing Angular Expressions
66
// ------------------------------
77
// Angular expressions are generally considered safe because these expressions only have direct
8-
// access to $scope and locals. However, one can obtain the ability to execute arbitrary JS code by
8+
// access to `$scope` and locals. However, one can obtain the ability to execute arbitrary JS code by
99
// obtaining a reference to native JS functions such as the Function constructor.
1010
//
1111
// As an example, consider the following Angular expression:
@@ -14,14 +14,16 @@ var $parseMinErr = minErr('$parse');
1414
//
1515
// This sandboxing technique is not perfect and doesn't aim to be. The goal is to prevent exploits
1616
// against the expression language, but not to prevent exploits that were enabled by exposing
17-
// sensitive JavaScript or browser apis on Scope. Exposing such objects on a Scope is never a good
17+
// sensitive JavaScript or browser APIs on Scope. Exposing such objects on a Scope is never a good
1818
// practice and therefore we are not even trying to protect against interaction with an object
1919
// explicitly exposed in this way.
2020
//
2121
// In general, it is not possible to access a Window object from an angular expression unless a
2222
// window or some DOM object that has a reference to window is published onto a Scope.
2323
// Similarly we prevent invocations of function known to be dangerous, as well as assignments to
2424
// native objects.
25+
//
26+
// See https://docs.angularjs.org/guide/security
2527

2628

2729
function ensureSafeMemberName(name, fullExpression) {

0 commit comments

Comments
 (0)