-
Notifications
You must be signed in to change notification settings - Fork 64
New Crowdin updates #1694
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
base: master
Are you sure you want to change the base?
New Crowdin updates #1694
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Manifest Files |
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.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
var deriv_cookie_domain = 'deriv.com' // Modify as per your actual usage | ||
var CookieStorage = function (cookie_name, cookie_domain = '') { | ||
var hostname = window.location.hostname | ||
var is_deriv_com = hostname.includes('deriv.com') |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization High
deriv.com
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 3 months ago
To fix the problem, we need to replace the substring check with a more secure method of verifying the hostname. Specifically, we should parse the URL and check if the host matches an allowed list of hosts. This ensures that the check is not bypassed by embedding the allowed host in an unexpected location within the URL.
- Parse the URL to extract the hostname.
- Check if the hostname matches an allowed list of hosts.
- Update the relevant lines in the code to implement this change.
-
Copy modified lines R491-R493
@@ -490,7 +490,7 @@ | ||
var CookieStorage = function (cookie_name, cookie_domain = '') { | ||
var hostname = window.location.hostname | ||
var is_deriv_com = hostname.includes('deriv.com') | ||
var hostname = new URL(window.location.href).hostname | ||
var allowedHosts = ['deriv.com', 'www.deriv.com'] | ||
var is_deriv_com = allowedHosts.includes(hostname) | ||
this.initialized = false | ||
this.cookie_name = cookie_name | ||
this.domain = is_deriv_com ? deriv_cookie_domain : cookie_domain || hostname | ||
this.path = '/' |
var deriv_cookie_domain = 'deriv.com' // Modify as per your actual usage | ||
var CookieStorage = function (cookie_name, cookie_domain = '') { | ||
var hostname = window.location.hostname | ||
var is_deriv_com = hostname.includes('deriv.com') |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization High
deriv.com
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 3 months ago
To fix the problem, we need to parse the URL and check the host value against a whitelist of allowed hosts. This ensures that the check handles arbitrary subdomain sequences correctly and prevents malicious URLs from bypassing the security check.
- Parse the URL to extract the hostname.
- Compare the extracted hostname against a whitelist of allowed hosts.
- Update the code to use this new approach.
-
Copy modified lines R491-R493
@@ -490,4 +490,5 @@ | ||
var CookieStorage = function (cookie_name, cookie_domain = '') { | ||
var hostname = window.location.hostname | ||
var is_deriv_com = hostname.includes('deriv.com') | ||
var hostname = new URL(window.location.href).hostname | ||
var allowedHosts = ['deriv.com', 'www.deriv.com'] | ||
var is_deriv_com = allowedHosts.includes(hostname) | ||
this.initialized = false |
var deriv_cookie_domain = 'deriv.com' // Modify as per your actual usage | ||
var CookieStorage = function (cookie_name, cookie_domain = '') { | ||
var hostname = window.location.hostname | ||
var is_deriv_com = hostname.includes('deriv.com') |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization High
deriv.com
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 3 months ago
To fix the problem, we need to replace the substring check with a more robust method of verifying the hostname. Specifically, we should parse the URL and check if the hostname matches an allowed list of hosts. This ensures that only the exact allowed hosts are accepted, preventing any bypass attempts.
- Parse the URL to extract the hostname.
- Use an explicit whitelist of allowed hosts to check if the hostname is valid.
- Update the relevant code to implement this change.
-
Copy modified lines R491-R493
@@ -490,4 +490,5 @@ | ||
var CookieStorage = function (cookie_name, cookie_domain = '') { | ||
var hostname = window.location.hostname | ||
var is_deriv_com = hostname.includes('deriv.com') | ||
var hostname = new URL(window.location.href).hostname | ||
var allowedHosts = ['deriv.com', 'beta.deriv.com', 'www.deriv.com'] | ||
var is_deriv_com = allowedHosts.includes(hostname) | ||
this.initialized = false |
var deriv_cookie_domain = 'deriv.com' // Modify as per your actual usage | ||
var CookieStorage = function (cookie_name, cookie_domain = '') { | ||
var hostname = window.location.hostname | ||
var is_deriv_com = hostname.includes('deriv.com') |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization High
deriv.com
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 3 months ago
To fix the problem, we need to replace the substring check with a more robust method of validating the hostname. Specifically, we should parse the URL and check if the hostname matches an allowed list of hosts. This ensures that the check handles arbitrary subdomain sequences correctly and prevents bypassing the validation.
- Parse the URL to extract the hostname.
- Use an explicit whitelist of allowed hosts to validate the hostname.
- Update the relevant lines in the code to implement this change.
-
Copy modified lines R491-R493
@@ -490,4 +490,5 @@ | ||
var CookieStorage = function (cookie_name, cookie_domain = '') { | ||
var hostname = window.location.hostname | ||
var is_deriv_com = hostname.includes('deriv.com') | ||
var hostname = new URL(window.location.href).hostname | ||
var allowedHosts = ['deriv.com', 'www.deriv.com'] | ||
var is_deriv_com = allowedHosts.includes(hostname) | ||
this.initialized = false |
var deriv_cookie_domain = 'deriv.com' // Modify as per your actual usage | ||
var CookieStorage = function (cookie_name, cookie_domain = '') { | ||
var hostname = window.location.hostname | ||
var is_deriv_com = hostname.includes('deriv.com') |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization High
deriv.com
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 3 months ago
To fix the problem, we need to replace the substring check with a more secure method of validating the hostname. Specifically, we should parse the URL and check if the host is in a whitelist of allowed hosts. This ensures that only the exact allowed hosts or their subdomains are accepted.
- Parse the URL to extract the hostname.
- Check if the extracted hostname is in a whitelist of allowed hosts.
- Replace the substring check with this new validation method.
-
Copy modified lines R491-R493
@@ -490,7 +490,7 @@ | ||
var CookieStorage = function (cookie_name, cookie_domain = '') { | ||
var hostname = window.location.hostname | ||
var is_deriv_com = hostname.includes('deriv.com') | ||
var hostname = new URL(window.location.href).hostname | ||
var allowedHosts = ['deriv.com', 'beta.deriv.com', 'www.deriv.com'] | ||
var is_deriv_com = allowedHosts.includes(hostname) | ||
this.initialized = false | ||
this.cookie_name = cookie_name | ||
this.domain = is_deriv_com ? deriv_cookie_domain : cookie_domain || hostname | ||
this.path = '/' |
var deriv_cookie_domain = 'deriv.com' // Modify as per your actual usage | ||
var CookieStorage = function (cookie_name, cookie_domain = '') { | ||
var hostname = window.location.hostname | ||
var is_deriv_com = hostname.includes('deriv.com') |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization High
deriv.com
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 3 months ago
To fix the problem, we need to ensure that the hostname is properly validated against a whitelist of allowed hosts. This involves parsing the URL to extract the hostname and then checking if it matches any of the allowed hosts. We will use the URL
constructor to parse the URL and compare the hostname against a predefined list of allowed hosts.
- Parse the URL using the
URL
constructor to extract the hostname. - Define a whitelist of allowed hosts.
- Check if the parsed hostname is in the whitelist.
- Update the code to use this secure method for hostname validation.
-
Copy modified lines R491-R493
@@ -490,4 +490,5 @@ | ||
var CookieStorage = function (cookie_name, cookie_domain = '') { | ||
var hostname = window.location.hostname | ||
var is_deriv_com = hostname.includes('deriv.com') | ||
var hostname = new URL(window.location.href).hostname | ||
var allowedHosts = ['deriv.com', 'www.deriv.com', 'beta.deriv.com'] | ||
var is_deriv_com = allowedHosts.includes(hostname) | ||
this.initialized = false |
var deriv_cookie_domain = 'deriv.com' // Modify as per your actual usage | ||
var CookieStorage = function (cookie_name, cookie_domain = '') { | ||
var hostname = window.location.hostname | ||
var is_deriv_com = hostname.includes('deriv.com') |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization High
deriv.com
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 3 months ago
To fix the problem, we need to parse the URL and check the host value against a whitelist of allowed hosts. This ensures that only legitimate subdomains of deriv.com
are accepted. We will use the URL
constructor to parse the URL and then check the hostname against a predefined list of allowed hosts.
- Parse the URL using the
URL
constructor. - Extract the hostname from the parsed URL.
- Check if the hostname is in the list of allowed hosts.
- Update the code to use this new check instead of the substring check.
-
Copy modified lines R491-R493
@@ -490,7 +490,7 @@ | ||
var CookieStorage = function (cookie_name, cookie_domain = '') { | ||
var hostname = window.location.hostname | ||
var is_deriv_com = hostname.includes('deriv.com') | ||
var hostname = new URL(window.location.href).hostname | ||
var allowedHosts = ['deriv.com', 'www.deriv.com', 'beta.deriv.com'] | ||
var is_deriv_com = allowedHosts.includes(hostname) | ||
this.initialized = false | ||
this.cookie_name = cookie_name | ||
this.domain = is_deriv_com ? deriv_cookie_domain : cookie_domain || hostname | ||
this.path = '/' |
.socketMessageSend(JSON.stringify(data), 'verify_email') | ||
.then(res => { | ||
if (language && language !== 'en') { | ||
window.location.href = `/${language}/verify-email?email=${email}` |
Check warning
Code scanning / CodeQL
DOM text reinterpreted as HTML Medium
DOM text
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 21 days ago
To fix the problem, we need to ensure that the email
variable is properly encoded before being included in the URL. This can be achieved by using the encodeURIComponent
function, which encodes a URI component by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character.
- Locate the line where the
email
variable is used in the URL redirection. - Replace the direct usage of
email
withencodeURIComponent(email)
to ensure that any special characters in the email are properly encoded.
-
Copy modified line R1578
@@ -1577,3 +1577,3 @@ | ||
if (language && language !== 'en') { | ||
window.location.href = `/${language}/verify-email?email=${email}` | ||
window.location.href = `/${language}/verify-email?email=${encodeURIComponent(email)}` | ||
} else { |
if (language && language !== 'en') { | ||
window.location.href = `/${language}/verify-email?email=${email}` | ||
} else { | ||
window.location.href = `/verify-email?email=${email}` |
Check warning
Code scanning / CodeQL
DOM text reinterpreted as HTML Medium
DOM text
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 21 days ago
To fix the problem, we need to ensure that the user-provided email is properly encoded before being included in the URL. This can be achieved by using encodeURIComponent
to encode the email, which will escape any special characters and prevent XSS attacks.
- Locate the line where the URL is constructed with the user-provided email.
- Replace the direct inclusion of the email with an encoded version using
encodeURIComponent
. - Ensure that the fix is applied consistently wherever the email is used in constructing URLs.
-
Copy modified line R1578 -
Copy modified line R1580
@@ -1577,5 +1577,5 @@ | ||
if (language && language !== 'en') { | ||
window.location.href = `/${language}/verify-email?email=${email}` | ||
window.location.href = `/${language}/verify-email?email=${encodeURIComponent(email)}` | ||
} else { | ||
window.location.href = `/verify-email?email=${email}` | ||
window.location.href = `/verify-email?email=${encodeURIComponent(email)}` | ||
} |
.socketMessageSend(JSON.stringify(data), 'verify_email') | ||
.then(res => { | ||
if (language && language !== 'en') { | ||
window.location.href = `/${language}/verify-email?email=${email}` |
Check warning
Code scanning / CodeQL
DOM text reinterpreted as HTML Medium
DOM text
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 21 days ago
To fix the problem, we need to ensure that the email
variable is properly encoded before being used in the URL. This can be achieved by using the encodeURIComponent
function, which encodes special characters in the email address, making it safe to include in a URL.
- Locate the line where the
email
variable is used in the URL construction. - Replace the direct usage of
email
withencodeURIComponent(email)
to ensure that any special characters are properly encoded. - This change should be made in the file
public/email/crowdin/translations/bn/lp-forex-ebook.html
on line 1578.
-
Copy modified line R1578
@@ -1577,3 +1577,3 @@ | ||
if (language && language !== 'en') { | ||
window.location.href = `/${language}/verify-email?email=${email}` | ||
window.location.href = `/${language}/verify-email?email=${encodeURIComponent(email)}` | ||
} else { |
if (language && language !== 'en') { | ||
window.location.href = `/${language}/verify-email?email=${email}` | ||
} else { | ||
window.location.href = `/verify-email?email=${email}` |
Check warning
Code scanning / CodeQL
DOM text reinterpreted as HTML Medium
DOM text
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 21 days ago
To fix the problem, we need to ensure that the email
value is properly encoded before being used in the URL. This can be achieved by using the encodeURIComponent
function, which encodes special characters in the email address, making it safe to include in a URL.
- Locate the line where the URL is constructed with the
email
value. - Replace the direct usage of
email
withencodeURIComponent(email)
to ensure the email is properly encoded. - This change should be made in the file
public/email/crowdin/translations/bn/lp-forex-ebook.html
on line 1580.
-
Copy modified line R1578 -
Copy modified line R1580
@@ -1577,5 +1577,5 @@ | ||
if (language && language !== 'en') { | ||
window.location.href = `/${language}/verify-email?email=${email}` | ||
window.location.href = `/${language}/verify-email?email=${encodeURIComponent(email)}` | ||
} else { | ||
window.location.href = `/verify-email?email=${email}` | ||
window.location.href = `/verify-email?email=${encodeURIComponent(email)}` | ||
} |
.socketMessageSend(JSON.stringify(data), 'verify_email') | ||
.then(res => { | ||
if (language && language !== 'en') { | ||
window.location.href = `/${language}/verify-email?email=${email}` |
Check warning
Code scanning / CodeQL
DOM text reinterpreted as HTML Medium
DOM text
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 21 days ago
To fix the problem, we need to ensure that the email
variable is properly encoded before being used in the URL. This can be achieved by using encodeURIComponent
to encode the email
variable, which will escape any special characters and prevent XSS attacks.
- Locate the line where the
email
variable is used in the URL. - Replace the direct usage of
email
withencodeURIComponent(email)
to ensure it is properly encoded.
-
Copy modified line R1578
@@ -1577,3 +1577,3 @@ | ||
if (language && language !== 'en') { | ||
window.location.href = `/${language}/verify-email?email=${email}` | ||
window.location.href = `/${language}/verify-email?email=${encodeURIComponent(email)}` | ||
} else { |
if (language && language !== 'en') { | ||
window.location.href = `/${language}/verify-email?email=${email}` | ||
} else { | ||
window.location.href = `/verify-email?email=${email}` |
Check warning
Code scanning / CodeQL
DOM text reinterpreted as HTML Medium
DOM text
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 21 days ago
To fix the problem, we need to ensure that the email
variable is properly encoded before being used in the URL. This can be achieved by using the encodeURIComponent
function, which encodes special characters in the email address, making it safe to include in a URL.
- Locate the line where the
email
variable is used in the URL. - Replace the direct interpolation of
email
withencodeURIComponent(email)
to ensure the email address is safely encoded.
-
Copy modified line R1578 -
Copy modified line R1580
@@ -1577,5 +1577,5 @@ | ||
if (language && language !== 'en') { | ||
window.location.href = `/${language}/verify-email?email=${email}` | ||
window.location.href = `/${language}/verify-email?email=${encodeURIComponent(email)}` | ||
} else { | ||
window.location.href = `/verify-email?email=${email}` | ||
window.location.href = `/verify-email?email=${encodeURIComponent(email)}` | ||
} |
.socketMessageSend(JSON.stringify(data), 'verify_email') | ||
.then(res => { | ||
if (language && language !== 'en') { | ||
window.location.href = `/${language}/verify-email?email=${email}` |
Check warning
Code scanning / CodeQL
DOM text reinterpreted as HTML Medium
DOM text
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 21 days ago
To fix the problem, we need to ensure that the email
variable is properly encoded before being used in the URL. This can be achieved by using the encodeURIComponent
function, which encodes special characters in the email address, making it safe to include in a URL.
- Locate the line where the
email
variable is used in the URL. - Replace the direct usage of
email
withencodeURIComponent(email)
to ensure that the email address is properly encoded.
-
Copy modified line R1578
@@ -1577,3 +1577,3 @@ | ||
if (language && language !== 'en') { | ||
window.location.href = `/${language}/verify-email?email=${email}` | ||
window.location.href = `/${language}/verify-email?email=${encodeURIComponent(email)}` | ||
} else { |
if (language && language !== 'en') { | ||
window.location.href = `/${language}/verify-email?email=${email}` | ||
} else { | ||
window.location.href = `/verify-email?email=${email}` |
Check warning
Code scanning / CodeQL
DOM text reinterpreted as HTML Medium
DOM text
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 21 days ago
To fix the problem, we need to ensure that the email
variable is properly encoded before being used in the URL. This can be achieved by using the encodeURIComponent
function, which encodes special characters in the email address, making it safe to include in a URL.
- Locate the line where the URL is constructed with the
email
variable. - Replace the direct use of
email
withencodeURIComponent(email)
to ensure that any special characters are properly encoded. - This change should be made in the file
public/email/crowdin/translations/fr/lp-forex-ebook.html
on line 1580.
-
Copy modified line R1578 -
Copy modified line R1580
@@ -1577,5 +1577,5 @@ | ||
if (language && language !== 'en') { | ||
window.location.href = `/${language}/verify-email?email=${email}` | ||
window.location.href = `/${language}/verify-email?email=${encodeURIComponent(email)}` | ||
} else { | ||
window.location.href = `/verify-email?email=${email}` | ||
window.location.href = `/verify-email?email=${encodeURIComponent(email)}` | ||
} |
.socketMessageSend(JSON.stringify(data), 'verify_email') | ||
.then(res => { | ||
if (language && language !== 'en') { | ||
window.location.href = `/${language}/verify-email?email=${email}` |
Check warning
Code scanning / CodeQL
DOM text reinterpreted as HTML Medium
DOM text
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 21 days ago
To fix the problem, we need to ensure that the email
variable is properly encoded before being used in the URL. This can be achieved by using the encodeURIComponent
function, which encodes special characters in the email address, making it safe to include in a URL.
- Replace the usage of the
email
variable in the URL construction withencodeURIComponent(email)
. - This change should be made on line 1578 and line 1580 to ensure the email is properly encoded in both cases.
-
Copy modified line R1578 -
Copy modified line R1580
@@ -1577,5 +1577,5 @@ | ||
if (language && language !== 'en') { | ||
window.location.href = `/${language}/verify-email?email=${email}` | ||
window.location.href = `/${language}/verify-email?email=${encodeURIComponent(email)}` | ||
} else { | ||
window.location.href = `/verify-email?email=${email}` | ||
window.location.href = `/verify-email?email=${encodeURIComponent(email)}` | ||
} |
if (language && language !== 'en') { | ||
window.location.href = `/${language}/verify-email?email=${email}` | ||
} else { | ||
window.location.href = `/verify-email?email=${email}` |
Check warning
Code scanning / CodeQL
DOM text reinterpreted as HTML Medium
DOM text
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 21 days ago
To fix the problem, we need to ensure that the user-provided email is properly encoded before being included in the URL. This can be achieved by using the encodeURIComponent
function, which encodes special characters in the email, making it safe to include in a URL.
- Replace the direct use of the
email
variable in the URL with an encoded version usingencodeURIComponent
. - This change should be made on line 1580 where the URL is constructed.
-
Copy modified line R1578 -
Copy modified line R1580
@@ -1577,5 +1577,5 @@ | ||
if (language && language !== 'en') { | ||
window.location.href = `/${language}/verify-email?email=${email}` | ||
window.location.href = `/${language}/verify-email?email=${encodeURIComponent(email)}` | ||
} else { | ||
window.location.href = `/verify-email?email=${email}` | ||
window.location.href = `/verify-email?email=${encodeURIComponent(email)}` | ||
} |
…l (without photos).docx (Uzbek)
…cuments.docx (Uzbek)
…mit documents.docx (Uzbek)
…cation failed.docx (Uzbek)
…odation details.docx (Uzbek)
…odation details.docx (Polish)
…odation details.docx (Portuguese)
…nts.docx (Polish)
…nts.docx (Portuguese)
…1.docx (Portuguese)
No description provided.