Skip to content

QUESTION: Security concerns #1755

Open
Open
@jonDel

Description

@jonDel

Issue type

I'm submitting a ...

  • bug report
  • feature request
  • question

Issue description

Hello. I'm new to frontend development, and after reading and implementing the authentication part of the nebular tutorial, some concerns came to my mind. In the case of the authentication using JWT token, after the login (when successful) nebular stores the token retrieved from the backend in the local storage, so it can be verified by the guards in order to enable further navigation to protected views. There is no more token validation between frontend and backend after that.
So, if an attacker never contact the backend and forge a token in the local storage, since the token validation is done only in the login, the guards will check for the existence of the token (forged) and wrongly assume a user is logged in. It could possibly lead the attacker to access all the protected views by forging the user role. I know that the calls to retrieve data from the backend won't work (the backend will discard the forged token), but I think an unauthorized user by definitition must not even navigate to any protected view. The solution would possibly be to change or extended the isauthenticated method to send an additional request to the API ( to a /status endpoint, per example), with the token from local storage in the header, instead of using local storage directly. Does it make sense?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions