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

Commit e0ee491

Browse files
committed
docs($parse): formatting, link to security docs
1 parent 7dfe82e commit e0ee491

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/ng/parse.js

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

2830

2931
function ensureSafeMemberName(name, fullExpression) {

0 commit comments

Comments
 (0)