CST-7217 Downloading MySQL Connector/J is vulnerable to MITM attacks

Description

  providers: [{provide: APP_BASE_HREF, useValue: '/'}]
})
class AppModule {
ngDoBootstrap() {}
}

In Liferay Portal 7.1.3, 7.2.1 and possibly earlier unsupported versions, the setup wizard will automatically download MySQL Connector/J if the selected database is MySQL. This download is done over a non-secure HTTP connection and is vulnerable to man in the middle (MITM) attacks.

 

2. Now to prevent the client-side parameters being sent to backend Liferay DXP we need to set a router option to use a hash (i.e. /#/{route}). Open your app-routing.module.ts file and in your @NgModule decorator set it like below:

import { Routes, RouterModule } from '@angular/router';

@NgModule({
  imports: [RouterModule.forRoot(routes,{useHash: true, enableTracing: false})],
  exports: [RouterModule]
})
export class AppRoutingModule { }

 

3. After that, deploy and test it.

npm run deploy

 

Inside your Liferay DXP when you call some route from your Angular Application you will see in the browser the ${domain}/#/{route}.