Skip to content

Security: Bug in R2 URL conversion function#386

Open
tuanaiseo wants to merge 1 commit into
maillab:mainfrom
tuanaiseo:contribai/fix/security/bug-in-r2-url-conversion-function
Open

Security: Bug in R2 URL conversion function#386
tuanaiseo wants to merge 1 commit into
maillab:mainfrom
tuanaiseo:contribai/fix/security/bug-in-r2-url-conversion-function

Conversation

@tuanaiseo
Copy link
Copy Markdown

Problem

In mail-vue/src/utils/convert.js, the cvtR2Url function has a bug: return + 'https://' + '' will evaluate to NaN due to the unary + operator. This will cause incorrect URL generation when key is falsy.

Severity: medium
File: mail-vue/src/utils/convert.js

Solution

Change return + 'https://' + '' to return '' or handle the null case properly

Changes

  • mail-vue/src/utils/convert.js (modified)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced

In mail-vue/src/utils/convert.js, the cvtR2Url function has a bug: `return + 'https://' + ''` will evaluate to NaN due to the unary + operator. This will cause incorrect URL generation when key is falsy.

Affected files: convert.js

Signed-off-by: tuanaiseo <221258316+tuanaiseo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant