Skip to content
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

Code Security Report: 1 high severity findings, 7 total findings [develop] #98

Open
1 task
mend-for-github-com bot opened this issue Jan 15, 2025 · 0 comments
Open
1 task
Labels
Mend: code security findings Code security findings detected by Mend

Comments

@mend-for-github-com
Copy link
Contributor

Code Security Report

Scan Metadata

Latest Scan: 2025-01-15 05:58pm
Total Findings: 7 | New Findings: 0 | Resolved Findings: 0
Tested Project Files: 292
Detected Programming Languages: 3 (Python*, JavaScript / TypeScript*, C/C++ (Beta))

  • Check this box to manually trigger a scan

Finding Details

SeverityVulnerability TypeCWEFileData FlowsDetected
HighDOM Based Cross-Site Scripting

CWE-79

github_issue_links.js:6

12025-01-15 06:01pm
Vulnerable Code

window.onload = function () {
const link = document.createElement("a");
link.classList.add("muted-link");
link.classList.add("github-issue-link");
link.text = "Give feedback";
link.href = (

1 Data Flow/s detected

+ `*Reported+from%3A+${location.href}*`

"https://github.com/canonical/cloud-init/issues/new?"

Secure Code Warrior Training Material

● Training

   ▪ Secure Code Warrior DOM Based Cross-Site Scripting Training

● Videos

   ▪ Secure Code Warrior DOM Based Cross-Site Scripting Video

 
MediumHardcoded Password/Credentials

CWE-798

DataSourceCloudStack.py:71

12025-01-15 06:01pm
Vulnerable Code

if password == "bad_request":

Secure Code Warrior Training Material

● Training

   ▪ Secure Code Warrior Hardcoded Password/Credentials Training

● Videos

   ▪ Secure Code Warrior Hardcoded Password/Credentials Video

● Further Reading

   ▪ OWASP Top Ten 2017 A3: Sensitive Data Exposure

   ▪ OWASP Top Ten Proactive Controls 2018 C8: Protect Data Everywhere

   ▪ OWASP Top Ten 2021 A02: Cryptographic Failures

 
LowLog Forging

CWE-117

mock-meta.py:386

12025-01-15 06:01pm
Vulnerable Code

}
return functools.partial(base_func, **kwargs)
def _do_response(self):
who = self.client_address
log.info("Got a call from %s for path %s", who, self.path)

1 Data Flow/s detected

log.info("Got a call from %s for path %s", who, self.path)

Secure Code Warrior Training Material

● Training

   ▪ Secure Code Warrior Log Forging Training

● Videos

   ▪ Secure Code Warrior Log Forging Video

● Further Reading

   ▪ OWASP Log Forging

 
LowWeak Hash Strength

CWE-328

util.py:1877

12025-01-15 06:01pm
Vulnerable Code

"""Hash the content of a binary buffer using SHA1.
@param f: buffered binary stream to hash.
@return: digested data as bytes.
"""
hasher = hashlib.sha1()

1 Data Flow/s detected

Secure Code Warrior Training Material

● Training

   ▪ Secure Code Warrior Weak Hash Strength Training

● Videos

   ▪ Secure Code Warrior Weak Hash Strength Video

● Further Reading

   ▪ OWASP Cryptographic Storage Cheat Sheet

   ▪ OWASP Transport Layer Protection Cheat Sheet

   ▪ OWASP Password Storage Cheat Sheet

   ▪ OWASP Using a broken or risky cryptographic algorithm article

 
LowWeak Hash Strength

CWE-328

util.py:1887

12025-01-15 06:01pm
Vulnerable Code

cloud-init/cloudinit/util.py

Lines 1882 to 1887 in 5c771b5

"""Hash the content of a binary buffer using SHA1.
@param f: buffered binary stream to hash.
@return: digested data as bytes.
"""
hasher = hashlib.sha1()

1 Data Flow/s detected

hasher = hashlib.sha1()

Secure Code Warrior Training Material

● Training

   ▪ Secure Code Warrior Weak Hash Strength Training

● Videos

   ▪ Secure Code Warrior Weak Hash Strength Video

● Further Reading

   ▪ OWASP Cryptographic Storage Cheat Sheet

   ▪ OWASP Transport Layer Protection Cheat Sheet

   ▪ OWASP Password Storage Cheat Sheet

   ▪ OWASP Using a broken or risky cryptographic algorithm article

 
LowWeak Hash Strength

CWE-328

util.py:1877

12025-01-15 06:01pm
Vulnerable Code

"""Hash the content of a binary buffer using SHA1.
@param f: buffered binary stream to hash.
@return: digested data as bytes.
"""
hasher = hashlib.sha1()

1 Data Flow/s detected

Secure Code Warrior Training Material

● Training

   ▪ Secure Code Warrior Weak Hash Strength Training

● Videos

   ▪ Secure Code Warrior Weak Hash Strength Video

● Further Reading

   ▪ OWASP Cryptographic Storage Cheat Sheet

   ▪ OWASP Transport Layer Protection Cheat Sheet

   ▪ OWASP Password Storage Cheat Sheet

   ▪ OWASP Using a broken or risky cryptographic algorithm article

 
LowLog Forging

CWE-117

mock-meta.py:356

12025-01-15 06:01pm
Vulnerable Code

func_mapping = {
"user-data": user_fetcher.get_data,
"meta-data": meta_fetcher.get_data,
}
segments = [piece for piece in path.split("/") if len(piece)]
log.info("Received segments %s", segments)

1 Data Flow/s detected

func = self._find_method(self.path)

def _find_method(self, path):

segments = [piece for piece in path.split("/") if len(piece)]

log.info("Received segments %s", segments)

Secure Code Warrior Training Material

● Training

   ▪ Secure Code Warrior Log Forging Training

● Videos

   ▪ Secure Code Warrior Log Forging Video

● Further Reading

   ▪ OWASP Log Forging

@mend-for-github-com mend-for-github-com bot added the Mend: code security findings Code security findings detected by Mend label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mend: code security findings Code security findings detected by Mend
Development

No branches or pull requests

0 participants