Title: $processModelValue() cannot pass objects through $formatters properly · Issue #17019 · angular/angular.js · GitHub
Open Graph Title: $processModelValue() cannot pass objects through $formatters properly · Issue #17019 · angular/angular.js
X Title: $processModelValue() cannot pass objects through $formatters properly · Issue #17019 · angular/angular.js
Description: I'm submitting a ... regression from 1.7.0 security issue issue caused by a new browser version other: . Current behavior: Currently, $setViewValue(value) function accepts objects as a value, but requires them to be a angular.copy of the...
Open Graph Description: I'm submitting a ... regression from 1.7.0 security issue issue caused by a new browser version other: . Current behavior: Currently, $setViewValue(value) function accepts objects as a value, but r...
X Description: I'm submitting a ... regression from 1.7.0 security issue issue caused by a new browser version other: . Current behavior: Currently, $setViewValue(value) function accepts objects as a value, b...
Opengraph URL: https://github.com/angular/angular.js/issues/17019
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"$processModelValue() cannot pass objects through $formatters properly","articleBody":"\r\n**I'm submitting a ...**\r\n\u003c!-- (check one with \"x\") --\u003e\r\n- [ ] regression from 1.7.0\r\n- [X] security issue\r\n- [ ] issue caused by a new browser version\r\n- [ ] other: .\r\n\r\n**Current behavior:**\r\nCurrently, $setViewValue(value) function accepts objects as a value, but requires them to be a angular.copy of the previous object - since otherwise it will not detect the change (no deep comparison). This is expected and documented behaviour. The opposite function, however, $processModelValue() function cannot properly process the $modelValue which is an object (an end result of the $setViewValue(object) function above), even though it implicitly should. It improperly treats it as a simple type, and within the $$format() function makes new $viewValue and $modelValue be the two references to the same object with properties - and therefore all $formatters also affect $modelValue where they should not - which affects $validators and causes them to fail where they should succeed. \r\n\r\nThis means that $modelValue object is being stored directly from user input, circumventing parsers altogether - which is a security concern.\r\n\r\n**Expected behavior:**\r\nThe $processModelValue() and consequently $$format() functions should properly detect if the $modelValue is an object, and ensure that formatters only act on a copy of the original $modelValue object, which copy the $$format() function should return.\r\n\r\n**Minimal reproduction of the problem with instructions:**\r\n\r\n**AngularJS version:** 1.7.9\r\n\r\n**Browser:** should be affecting ALL browsers, explicitly observed in Chrome 81\r\n\r\n**Anything else:**\r\nCan be fixed by replacing the line 1042 of ngModel.js file:\r\nFrom:\r\n`var viewValue = this.$modelValue;`\r\nTo:\r\n`var viewValue = angular.copy(this.$modelValue);`\r\n","author":{"url":"https://github.com/alutsky","@type":"Person","name":"alutsky"},"datePublished":"2020-04-23T21:19:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/17019/angular.js/issues/17019"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0a3e8c0c-b4de-53f2-019a-287f62f13f9c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A4AC:77AC4:8C9B07:C5AAFB:696E611C |
| html-safe-nonce | d2dc5750ec6e5b3324d405cdc3d4aa2b715f3a8e00c40e7a096e472afe00d6d4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNEFDOjc3QUM0OjhDOUIwNzpDNUFBRkI6Njk2RTYxMUMiLCJ2aXNpdG9yX2lkIjoiMTc0OTgwNTUzNjg0MTE5NTgwNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c26d15775928a82eba2cdc4fa9902aae8d2a6c371b30434264105319333db029 |
| hovercard-subject-tag | issue:605881405 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular.js/17019/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f3ac6223731b07eaa22d55ea791084324e9ac164455d48c6481b513ba2778247/angular/angular.js/issues/17019 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f3ac6223731b07eaa22d55ea791084324e9ac164455d48c6481b513ba2778247/angular/angular.js/issues/17019 |
| og:image:alt | I'm submitting a ... regression from 1.7.0 security issue issue caused by a new browser version other: . Current behavior: Currently, $setViewValue(value) function accepts objects as a value, but r... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | alutsky |
| hostname | github.com |
| expected-hostname | github.com |
| None | f68b42d371252b0f236260d6234f4304a806fe5ac43d59faa21fb59d80df103b |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular.js git https://github.com/angular/angular.js.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 460078 |
| octolytics-dimension-repository_nwo | angular/angular.js |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 460078 |
| octolytics-dimension-repository_network_root_nwo | angular/angular.js |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6b74bc8dbcd10b5d69fd9ee9d2cfdc8b35e18a4c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width