angular.js/src
Chirayu Krishnappa 38deedd6e3 fix($compile): reject multi-expression interpolations for src attribute
BREAKING CHANGE: Concatenating expressions makes it hard to reason about
    whether some combination of concatenated values are unsafe to use
    and could easily lead to XSS.  By requiring that a single expression
    be used for *[src/ng-src] such as iframe[src], object[src], etc.
    (but not img[src/ng-src] since that value is sanitized), we ensure that the value
    that's used is assigned or constructed by some JS code somewhere
    that is more testable or make it obvious that you bound the value to
    some user controlled value.  This helps reduce the load when
    auditing for XSS issues.

    To migrate your code, follow the example below:

        Before:
            JS:
                scope.baseUrl = 'page';
                scope.a = 1;
                scope.b = 2;
            HTML:
                <!-- Are a and b properly escaped here? Is baseUrl
                     controlled by user? -->
                <iframe src="{{baseUrl}}?a={{a}&b={{b}}">

        After:
            JS:
                var baseUrl = "page";
                scope.getIframeSrc = function() {
                  // There are obviously better ways to do this.  The
                  // key point is that one will think about this and do
                  // it the right way.
                  var qs = ["a", "b"].map(function(value, name) {
                      return encodeURIComponent(name) + "=" +
                             encodeURIComponent(value);
                    }).join("&");
                  // baseUrl isn't on scope so it isn't bound to a user
                  // controlled value.
                  return baseUrl + "?" + qs;
                }
            HTML: <iframe src="{{getIframeSrc()}}">
2013-06-24 14:17:18 -07:00
..
auto chore(minErr): replace ngError with minErr 2013-06-17 13:29:30 -07:00
ng fix($compile): reject multi-expression interpolations for src attribute 2013-06-24 14:17:18 -07:00
ngCookies feat($cookieStore): $cookieStore.get now parses blank string as blank string 2013-05-08 10:04:07 +01:00
ngLocale fix(i18n): escape all chars above \u007f in locale files 2013-04-17 22:13:49 +01:00
ngMobile feat(jqLite): switch bind/unbind to more recent jQuery on/off 2013-06-19 20:53:24 +01:00
ngMock feat(jqLite): switch bind/unbind to more recent jQuery on/off 2013-06-19 20:53:24 +01:00
ngResource refactor($route): pull $route and friends into angular-route.js 2013-06-06 17:07:12 -07:00
ngRoute docs(ngRoute): clarify when gets updated 2013-06-11 22:15:54 +01:00
ngSanitize docs(sanitize): add @description section 2013-06-04 21:48:39 +01:00
ngScenario feat(jqLite): switch bind/unbind to more recent jQuery on/off 2013-06-19 20:53:24 +01:00
Angular.js refactor(angular.bootstrap): rename internal function 2013-06-20 15:22:35 +01:00
angular.prefix chore(license): update to google 2012-04-20 11:29:34 -07:00
angular.suffix fix(init): use jQuery#ready for init if available 2012-03-23 15:41:37 -07:00
AngularPublic.js chore(AngularPublic): remove angular.noConflict feature 2013-06-06 22:06:50 -07:00
apis.js feat(ngRepeat): add support for custom tracking of items 2013-03-29 23:01:52 -07:00
jqLite.js feat(jqLite): switch bind/unbind to more recent jQuery on/off 2013-06-19 20:53:24 +01:00
loader.js docs(loader): fix typo and minor semantic error 2013-06-18 21:21:20 +01:00
loader.prefix chore(license): update to google 2012-04-20 11:29:34 -07:00
loader.suffix feat(module): new module loader 2012-01-10 22:27:00 -08:00
minErr.js chore(minErr): replace ngError with minErr 2013-06-17 13:29:30 -07:00
module.prefix chore(module): improved module prefix/suffix code 2012-05-04 15:50:37 -07:00
module.suffix chore(module): improved module prefix/suffix code 2012-05-04 15:50:37 -07:00
publishExternalApis.js chore(Rakefile): get ready for modules 2012-03-28 11:16:36 -07:00