-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Срок действия сессии в памяти #114
Conversation
this.sessions[id] = session; | ||
if (lifetime) { | ||
this.sessions[id].expires = Date.now() + lifetime; |
Check warning
Code scanning / Semgrep
Semgrep Finding: gitlab.eslint.detect-object-injection Warning
async validate() { | ||
Object.keys(this.sessions).forEach((sessionId) => { | ||
if (this.sessions[sessionId].expires && this.sessions[sessionId].expires < Date.now()) { | ||
delete this.sessions[sessionId]; |
Check warning
Code scanning / Semgrep
Bracket object notation with user input is present, this might allow an attacker to access all properties of the object and even it's prototype, leading to possible code execution. Warning
25967d5
to
e6fb766
Compare
|
||
async validate() { | ||
Object.keys(this.sessions).forEach((sessionId) => { | ||
const { expires } = this.sessions[sessionId]; |
Check warning
Code scanning / Semgrep
Semgrep Finding: gitlab.eslint.detect-object-injection Warning
this.sessions[id] = session; | ||
if (lifetime) { | ||
this.sessions[id].expires = Date.now() + lifetime; |
Check warning
Code scanning / CodeQL
Prototype-polluting assignment
this.sessions[id] = session; | ||
if (lifetime) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Возможно, правильней lifetime > 0
56c1fb9
to
06dd548
Compare
📦 Published PR as canary version:
Canary Versions
✨ Test out this PR locally via: