Skip to content

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

Open
wants to merge 10,000 commits into
base: master
Choose a base branch
from
Open

New Crowdin updates #1694

wants to merge 10,000 commits into from

Conversation

ashkan-deriv
Copy link
Contributor

No description provided.

Copy link

github-actions bot commented Apr 22, 2024

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

Copy link

@github-advanced-security github-advanced-security bot left a 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
' can be anywhere in the URL, and arbitrary hosts may come before or after it.

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.

  1. Parse the URL to extract the hostname.
  2. Check if the hostname matches an allowed list of hosts.
  3. Update the relevant lines in the code to implement this change.
Suggested changeset 1
public/email/crowdin/translations/ar/lp-forex-ebook.html

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/public/email/crowdin/translations/ar/lp-forex-ebook.html b/public/email/crowdin/translations/ar/lp-forex-ebook.html
--- a/public/email/crowdin/translations/ar/lp-forex-ebook.html
+++ b/public/email/crowdin/translations/ar/lp-forex-ebook.html
@@ -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 = '/'
EOF
@@ -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 = '/'
Copilot is powered by AI and may make mistakes. Always verify output.
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
' can be anywhere in the URL, and arbitrary hosts may come before or after it.

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.

  1. Parse the URL to extract the hostname.
  2. Compare the extracted hostname against a whitelist of allowed hosts.
  3. Update the code to use this new approach.
Suggested changeset 1
public/email/crowdin/translations/bn/lp-forex-ebook.html

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/public/email/crowdin/translations/bn/lp-forex-ebook.html b/public/email/crowdin/translations/bn/lp-forex-ebook.html
--- a/public/email/crowdin/translations/bn/lp-forex-ebook.html
+++ b/public/email/crowdin/translations/bn/lp-forex-ebook.html
@@ -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
EOF
@@ -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
Copilot is powered by AI and may make mistakes. Always verify output.
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
' can be anywhere in the URL, and arbitrary hosts may come before or after it.

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.

  1. Parse the URL to extract the hostname.
  2. Use an explicit whitelist of allowed hosts to check if the hostname is valid.
  3. Update the relevant code to implement this change.
Suggested changeset 1
public/email/crowdin/translations/de/lp-forex-ebook.html

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/public/email/crowdin/translations/de/lp-forex-ebook.html b/public/email/crowdin/translations/de/lp-forex-ebook.html
--- a/public/email/crowdin/translations/de/lp-forex-ebook.html
+++ b/public/email/crowdin/translations/de/lp-forex-ebook.html
@@ -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
EOF
@@ -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
Copilot is powered by AI and may make mistakes. Always verify output.
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
' can be anywhere in the URL, and arbitrary hosts may come before or after it.

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.

  1. Parse the URL to extract the hostname.
  2. Use an explicit whitelist of allowed hosts to validate the hostname.
  3. Update the relevant lines in the code to implement this change.
Suggested changeset 1
public/email/crowdin/translations/es/lp-forex-ebook.html

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/public/email/crowdin/translations/es/lp-forex-ebook.html b/public/email/crowdin/translations/es/lp-forex-ebook.html
--- a/public/email/crowdin/translations/es/lp-forex-ebook.html
+++ b/public/email/crowdin/translations/es/lp-forex-ebook.html
@@ -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
EOF
@@ -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
Copilot is powered by AI and may make mistakes. Always verify output.
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
' can be anywhere in the URL, and arbitrary hosts may come before or after it.

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.

  1. Parse the URL to extract the hostname.
  2. Check if the extracted hostname is in a whitelist of allowed hosts.
  3. Replace the substring check with this new validation method.
Suggested changeset 1
public/email/crowdin/translations/fr/lp-forex-ebook.html

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/public/email/crowdin/translations/fr/lp-forex-ebook.html b/public/email/crowdin/translations/fr/lp-forex-ebook.html
--- a/public/email/crowdin/translations/fr/lp-forex-ebook.html
+++ b/public/email/crowdin/translations/fr/lp-forex-ebook.html
@@ -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 = '/'
EOF
@@ -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 = '/'
Copilot is powered by AI and may make mistakes. Always verify output.
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
' can be anywhere in the URL, and arbitrary hosts may come before or after it.

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.

  1. Parse the URL using the URL constructor to extract the hostname.
  2. Define a whitelist of allowed hosts.
  3. Check if the parsed hostname is in the whitelist.
  4. Update the code to use this secure method for hostname validation.
Suggested changeset 1
public/email/crowdin/translations/id/lp-forex-ebook.html

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/public/email/crowdin/translations/id/lp-forex-ebook.html b/public/email/crowdin/translations/id/lp-forex-ebook.html
--- a/public/email/crowdin/translations/id/lp-forex-ebook.html
+++ b/public/email/crowdin/translations/id/lp-forex-ebook.html
@@ -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
EOF
@@ -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
Copilot is powered by AI and may make mistakes. Always verify output.
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
' can be anywhere in the URL, and arbitrary hosts may come before or after it.

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.

  1. Parse the URL using the URL constructor.
  2. Extract the hostname from the parsed URL.
  3. Check if the hostname is in the list of allowed hosts.
  4. Update the code to use this new check instead of the substring check.
Suggested changeset 1
public/email/crowdin/translations/it/lp-forex-ebook.html

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/public/email/crowdin/translations/it/lp-forex-ebook.html b/public/email/crowdin/translations/it/lp-forex-ebook.html
--- a/public/email/crowdin/translations/it/lp-forex-ebook.html
+++ b/public/email/crowdin/translations/it/lp-forex-ebook.html
@@ -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 = '/'
EOF
@@ -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 = '/'
Copilot is powered by AI and may make mistakes. Always verify output.
.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
is reinterpreted as HTML without escaping meta-characters.

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 with encodeURIComponent(email) to ensure that any special characters in the email are properly encoded.
Suggested changeset 1
public/email/crowdin/translations/ar/lp-forex-ebook.html

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/public/email/crowdin/translations/ar/lp-forex-ebook.html b/public/email/crowdin/translations/ar/lp-forex-ebook.html
--- a/public/email/crowdin/translations/ar/lp-forex-ebook.html
+++ b/public/email/crowdin/translations/ar/lp-forex-ebook.html
@@ -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 {
EOF
@@ -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 {
Copilot is powered by AI and may make mistakes. Always verify output.
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
is reinterpreted as HTML without escaping meta-characters.

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.
Suggested changeset 1
public/email/crowdin/translations/ar/lp-forex-ebook.html

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/public/email/crowdin/translations/ar/lp-forex-ebook.html b/public/email/crowdin/translations/ar/lp-forex-ebook.html
--- a/public/email/crowdin/translations/ar/lp-forex-ebook.html
+++ b/public/email/crowdin/translations/ar/lp-forex-ebook.html
@@ -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)}`
                         }
EOF
@@ -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)}`
}
Copilot is powered by AI and may make mistakes. Always verify output.
.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
is reinterpreted as HTML without escaping meta-characters.

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 with encodeURIComponent(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.
Suggested changeset 1
public/email/crowdin/translations/bn/lp-forex-ebook.html

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/public/email/crowdin/translations/bn/lp-forex-ebook.html b/public/email/crowdin/translations/bn/lp-forex-ebook.html
--- a/public/email/crowdin/translations/bn/lp-forex-ebook.html
+++ b/public/email/crowdin/translations/bn/lp-forex-ebook.html
@@ -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 {
EOF
@@ -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 {
Copilot is powered by AI and may make mistakes. Always verify output.
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
is reinterpreted as HTML without escaping meta-characters.

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 with encodeURIComponent(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.
Suggested changeset 1
public/email/crowdin/translations/bn/lp-forex-ebook.html

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/public/email/crowdin/translations/bn/lp-forex-ebook.html b/public/email/crowdin/translations/bn/lp-forex-ebook.html
--- a/public/email/crowdin/translations/bn/lp-forex-ebook.html
+++ b/public/email/crowdin/translations/bn/lp-forex-ebook.html
@@ -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)}`
                         }
EOF
@@ -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)}`
}
Copilot is powered by AI and may make mistakes. Always verify output.
.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
is reinterpreted as HTML without escaping meta-characters.

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 with encodeURIComponent(email) to ensure it is properly encoded.
Suggested changeset 1
public/email/crowdin/translations/de/lp-forex-ebook.html

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/public/email/crowdin/translations/de/lp-forex-ebook.html b/public/email/crowdin/translations/de/lp-forex-ebook.html
--- a/public/email/crowdin/translations/de/lp-forex-ebook.html
+++ b/public/email/crowdin/translations/de/lp-forex-ebook.html
@@ -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 {
EOF
@@ -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 {
Copilot is powered by AI and may make mistakes. Always verify output.
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
is reinterpreted as HTML without escaping meta-characters.

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 with encodeURIComponent(email) to ensure the email address is safely encoded.
Suggested changeset 1
public/email/crowdin/translations/es/lp-forex-ebook.html

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/public/email/crowdin/translations/es/lp-forex-ebook.html b/public/email/crowdin/translations/es/lp-forex-ebook.html
--- a/public/email/crowdin/translations/es/lp-forex-ebook.html
+++ b/public/email/crowdin/translations/es/lp-forex-ebook.html
@@ -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)}`
                         }
EOF
@@ -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)}`
}
Copilot is powered by AI and may make mistakes. Always verify output.
.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
is reinterpreted as HTML without escaping meta-characters.

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 with encodeURIComponent(email) to ensure that the email address is properly encoded.
Suggested changeset 1
public/email/crowdin/translations/fr/lp-forex-ebook.html

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/public/email/crowdin/translations/fr/lp-forex-ebook.html b/public/email/crowdin/translations/fr/lp-forex-ebook.html
--- a/public/email/crowdin/translations/fr/lp-forex-ebook.html
+++ b/public/email/crowdin/translations/fr/lp-forex-ebook.html
@@ -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 {
EOF
@@ -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 {
Copilot is powered by AI and may make mistakes. Always verify output.
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
is reinterpreted as HTML without escaping meta-characters.

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 with encodeURIComponent(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.
Suggested changeset 1
public/email/crowdin/translations/fr/lp-forex-ebook.html

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/public/email/crowdin/translations/fr/lp-forex-ebook.html b/public/email/crowdin/translations/fr/lp-forex-ebook.html
--- a/public/email/crowdin/translations/fr/lp-forex-ebook.html
+++ b/public/email/crowdin/translations/fr/lp-forex-ebook.html
@@ -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)}`
                         }
EOF
@@ -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)}`
}
Copilot is powered by AI and may make mistakes. Always verify output.
.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
is reinterpreted as HTML without escaping meta-characters.

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 with encodeURIComponent(email).
  • This change should be made on line 1578 and line 1580 to ensure the email is properly encoded in both cases.
Suggested changeset 1
public/email/crowdin/translations/id/lp-forex-ebook.html

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/public/email/crowdin/translations/id/lp-forex-ebook.html b/public/email/crowdin/translations/id/lp-forex-ebook.html
--- a/public/email/crowdin/translations/id/lp-forex-ebook.html
+++ b/public/email/crowdin/translations/id/lp-forex-ebook.html
@@ -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)}`
                         }
EOF
@@ -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)}`
}
Copilot is powered by AI and may make mistakes. Always verify output.
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
is reinterpreted as HTML without escaping meta-characters.

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 using encodeURIComponent.
  • This change should be made on line 1580 where the URL is constructed.
Suggested changeset 1
public/email/crowdin/translations/id/lp-forex-ebook.html

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/public/email/crowdin/translations/id/lp-forex-ebook.html b/public/email/crowdin/translations/id/lp-forex-ebook.html
--- a/public/email/crowdin/translations/id/lp-forex-ebook.html
+++ b/public/email/crowdin/translations/id/lp-forex-ebook.html
@@ -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)}`
                         }
EOF
@@ -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)}`
}
Copilot is powered by AI and may make mistakes. Always verify output.
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