scan4secrets report

24 findings · generated by scan4secrets v2
critical: 3high: 9medium: 10low: 2
criticalKotlin OS Command Injectionexamples/sample-app/src/Main.kt:2CWE-78
Request/intent input reaches Runtime.exec or ProcessBuilder, often via string interpolation.
examples/sample-app/src/Main.kt:2
Runtime.getRuntime().exec("sh -c " + intent.getStringExtra("cmd"))  // cmd injection (CWE-78)
ProcessBuilder(listOf("convert", validated(file), "out.png")).start()
Pass a fixed argv list with validated arguments; never build a shell string from input.
Arbitrary OS command execution in the server or app process.
Server takeover (Ktor) or device compromise (Android) via a single tainted value.
CWE-78A03:2021 Injectionrule: kotlin-command-injection-exec
criticalOS Command Injectionexamples/sample-app/src/app.py:5CWE-78
Shell command built from dynamic input via os.system/subprocess/os.popen
examples/sample-app/src/app.py:5
os.system("ping -c 1 " + host)                          # command injection (CWE-78)
subprocess.run(["ping", "-c", "1", host], shell=False, check=True)
Never build a shell string from input. Pass an argument list and avoid shell=True.
Arbitrary command execution as the app user; full host compromise, lateral movement.
Complete server takeover, data theft, ransomware staging, regulatory breach.
CWE-78A03:2021 Injectionrule: py-command-injection
criticalOS Command Injectionexamples/sample-app/src/server.js:5CWE-78
child_process shell exec built from dynamic input
examples/sample-app/src/server.js:5
cp.exec('convert ' + req.query.file);                     // command injection (CWE-78)
execFile("ping", ["-c", "1", host], (e, out) => { ... })
Use execFile/spawn with an argument array and shell:false; never concatenate.
Arbitrary command execution on the server.
Full host takeover and data breach.
CWE-78A03:2021 Injectionrule: node-command-injection
highRemote Script Piped to Shellexamples/sample-app/Dockerfile:2CWE-494
Downloaded script piped directly into a shell interpreter.
examples/sample-app/Dockerfile:2
RUN curl -fsSL https://get.example.com/install.sh | bash   # remote script piped to shell (CWE-494)
RUN curl -fsSLo i.sh https://x/i.sh && echo "<sha256>  i.sh" | sha256sum -c && sh i.sh
Pin and checksum-verify the artifact before execution.
A compromised or MITM'd endpoint runs arbitrary code at build time.
Supply-chain compromise of the built image.
CWE-494A08:2021 Software and Data Integrity Failuresrule: iac-docker-curl-pipe-shell
highAndroid WebView addJavascriptInterface Exposureexamples/sample-app/src/Main.kt:3CWE-749
addJavascriptInterface exposes native methods to page JavaScript, risking RCE from loaded content.
examples/sample-app/src/Main.kt:3
webView.addJavascriptInterface(JsBridge(), "android")               // Android JS bridge (CWE-749)
// prefer WebMessageListener with a fixed allowlisted origin
Avoid the bridge; if required, gate methods with @JavascriptInterface and load only trusted content.
Malicious page JS invokes native methods, reaching the app's permissions.
Device/app compromise and theft of user data via a hostile web page.
CWE-749A05:2021 Security Misconfigurationrule: kotlin-android-webview-javascript-interface
highCross-Site Scripting (dangerouslySetInnerHTML)examples/sample-app/src/Widget.jsx:3CWE-79
Raw HTML injected into the DOM via dangerouslySetInnerHTML
examples/sample-app/src/Widget.jsx:3
return <div dangerouslySetInnerHTML={{ __html: html }} />;
<div dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(html) }} />
Render as text, or sanitize with DOMPurify before injecting.
Script execution in the victim's session (XSS).
Account takeover, session theft, defacement.
CWE-79A03:2021 Injectionrule: react-dangerous-innerhtml
highSQL Injectionexamples/sample-app/src/app.py:6CWE-89
SQL string built with %/format/f-string/concatenation instead of parameters
examples/sample-app/src/app.py:6
cursor.execute("SELECT * FROM users WHERE name = '%s'" % host)  # SQL injection (CWE-89)
cursor.execute("SELECT * FROM users WHERE id = %s", (user_id,))
Use parameterized queries — pass values as the second argument, never interpolate.
Read/modify arbitrary DB rows, authentication bypass, possible RCE via stacked queries.
Mass data breach, account takeover, data integrity loss.
CWE-89A03:2021 Injectionrule: py-sql-injection
highServer-Side Request Forgery (SSRF)examples/sample-app/src/app.py:7CWE-918
Outbound HTTP request to a URL derived from user input
examples/sample-app/src/app.py:7
requests.get(request.args.get("url"), verify=False)     # SSRF + disabled TLS (CWE-918/295)
host = urlparse(url).hostname
if host not in ALLOWED_HOSTS: abort(400)
Allowlist destination hosts/schemes; block link-local/metadata ranges (169.254.169.254).
Access to internal services, cloud metadata credential theft.
Cloud account takeover via stolen instance credentials.
CWE-918A10:2021 Server-Side Request Forgeryrule: py-ssrf
highDisabled TLS Certificate Verificationexamples/sample-app/src/app.py:7CWE-295
TLS verification turned off (verify=False / unverified context)
examples/sample-app/src/app.py:7
requests.get(request.args.get("url"), verify=False)     # SSRF + disabled TLS (CWE-918/295)
requests.get(url, verify=True)         # or verify="/path/ca-bundle.pem"
Leave verification enabled; pin/verify against a trusted CA bundle.
Man-in-the-middle interception of "encrypted" traffic.
Credential/session theft over hostile networks.
CWE-295A02:2021 Cryptographic Failuresrule: py-insecure-tls
highPath Traversalexamples/sample-app/src/app.py:8CWE-22
File path built from request input without normalization
examples/sample-app/src/app.py:8
open("/data/" + request.args.get("f"))                  # path traversal (CWE-22)
base = Path("/srv/data").resolve()
target = (base / name).resolve()
if base not in target.parents: abort(403)
Resolve the real path and confirm it stays within an allowed base dir.
Read/write arbitrary files (/etc/passwd, source, keys).
Source/secret disclosure, config tampering.
CWE-22A01:2021 Broken Access Controlrule: py-path-traversal
highReflected XSS via Express response of request inputexamples/sample-app/src/server.js:3CWE-79
Request query/body/param concatenated into an HTML response body unescaped.
examples/sample-app/src/server.js:3
res.send(`<h1>${req.query.q}</h1>`);                      // reflected XSS (CWE-79)
res.send(`<h1>${escapeHtml(req.query.q)}</h1>`);
Escape user input or render through an auto-escaping template engine.
Arbitrary script execution in the victim browser against the application origin.
Credential and token theft leading to account takeover and reputational damage.
CWE-79A03:2021 Injectionrule: web-xss-node-response-taint
highSQL Injectionexamples/sample-app/src/server.js:4CWE-89
SQL built with string concatenation / template literals
examples/sample-app/src/server.js:4
db.query(`SELECT * FROM u WHERE id = ${req.params.id}`);  // SQL injection (CWE-89)
db.query("SELECT * FROM users WHERE id = ?", [userId]);
Use parameterized queries / bound placeholders.
Full database read/write, auth bypass.
Mass data breach and account takeover.
CWE-89A03:2021 Injectionrule: node-sql-injection
mediumCredential-named env/config variable assigned a value (.env / shell / dotenv style)examples/sample-app/.env:4env-named-credential-assignment
Credential-named env/config variable assigned a value (.env / shell / dotenv style)
examples/sample-app/.env:4
s3cr3tCl13ntV4lu
AM_CLIENT_SECRET=s3cr3tCl13ntV4lu
rule: env-named-credential-assignmententropy: 3.45not checkedsha256: 08797118b38b4a2e…
mediumCredential-named env/config variable assigned a value (.env / shell / dotenv style)examples/sample-app/.env:5env-named-credential-assignment
Credential-named env/config variable assigned a value (.env / shell / dotenv style)
examples/sample-app/.env:5
0Iael9zksjdhfg8273hdksjf
SESSION_SECRET=0Iael9zksjdhfg8273hdksjf
rule: env-named-credential-assignmententropy: 4.08not checkedsha256: 44a4075b389d8451…
mediumCredential-named env/config variable assigned a value (.env / shell / dotenv style)examples/sample-app/.env:6env-named-credential-assignment
Credential-named env/config variable assigned a value (.env / shell / dotenv style)
examples/sample-app/.env:6
Sup3rP@ssw0rdDB
DATABASE_PASSWORD=Sup3rP@ssw0rdDB
rule: env-named-credential-assignmententropy: 3.64not checkedsha256: 1e5283363899ef42…
mediumCredential-named env/config variable assigned a value (.env / shell / dotenv style)examples/sample-app/.env:7env-named-credential-assignment
Credential-named env/config variable assigned a value (.env / shell / dotenv style)
examples/sample-app/.env:7
aGVsbG9lbmNyeXB0aW9ua2V5MTIz
ENCRYPTION_KEY=aGVsbG9lbmNyeXB0aW9ua2V5MTIz
rule: env-named-credential-assignmententropy: 4.35not checkedsha256: c79fbb6e4033e06d…
mediumHTTP Basic auth credential assigned in code/config (basic_auth = "...")examples/sample-app/.env:8basic-auth-credential
HTTP Basic auth credential assigned in code/config (basic_auth = "...")
examples/sample-app/.env:8
eAxbYmFzaWM6Y3JlZHM=
basic_auth = "eAxbYmFzaWM6Y3JlZHM="
rule: basic-auth-credentialentropy: 4.12not checkedsha256: da9b783e107b96c6…
mediumWeak Cryptographic Hashexamples/sample-app/src/app.py:9CWE-327
MD5/SHA1 used for security-sensitive hashing
examples/sample-app/src/app.py:9
hashlib.md5(host.encode())                              # weak hash (CWE-327)
hashlib.sha256(data).hexdigest()
bcrypt.hashpw(pw, bcrypt.gensalt())    # passwords
Use SHA-256+ for integrity; use bcrypt/scrypt/argon2 for passwords.
Collision/preimage attacks; fast password cracking.
Credential compromise, integrity bypass.
CWE-327A02:2021 Cryptographic Failuresrule: py-weak-hash
mediumOpen Redirectexamples/sample-app/src/server.js:6CWE-601
Redirect target taken directly from request input
examples/sample-app/src/server.js:6
res.redirect(req.query.next);                             // open redirect (CWE-601)
const dest = SAFE_PATHS.has(req.query.next) ? req.query.next : "/";
res.redirect(dest);
Allowlist redirect targets or restrict to same-origin relative paths.
Phishing and OAuth token theft via attacker-controlled redirect.
Credential/token theft, brand abuse.
CWE-601A01:2021 Broken Access Controlrule: node-open-redirect
ships verbose errors, disables optimizations, and lengthens request timeouts. cwe-489 a05:2021 security misconfiguration" data-sevrank='2' data-file="examples/sample-app/web.config" data-line='3' data-name="asp.net debug compilation enabled in production">mediumASP.NET Debug Compilation Enabled in Productionexamples/sample-app/web.config:3CWE-489
<compilation debug="true"> ships verbose errors, disables optimizations, and lengthens request timeouts.
examples/sample-app/web.config:3
<compilation debug="true"/>                    <!-- debug enabled (CWE-11) -->
<compilation debug="false" targetFramework="4.8" />
Set debug="false" for production deployments and enable <deployment retail="true"/> on the server.
Detailed exception pages leak source paths, versions, and stack traces, and the app is more DoS-prone.
Reconnaissance data handed to attackers and degraded availability under load.
CWE-489A05:2021 Security Misconfigurationrule: dotnet-debug-enabled
returns full stack traces and framework banners to remote clients. cwe-209 a05:2021 security misconfiguration" data-sevrank='2' data-file="examples/sample-app/web.config" data-line='4' data-name="asp.net customerrors off (stack trace disclosure)">mediumASP.NET customErrors Off (Stack Trace Disclosure)examples/sample-app/web.config:4CWE-209
<customErrors mode="Off"> returns full stack traces and framework banners to remote clients.
examples/sample-app/web.config:4
<customErrors mode="Off"/>                     <!-- stack traces exposed -->
<customErrors mode="RemoteOnly" defaultRedirect="~/Error" />
Use mode="RemoteOnly" (or On) with a generic defaultRedirect error page in production.
Yellow-screen-of-death pages expose method names, file paths, connection strings, and exact patch levels.
Internal architecture and occasionally credentials are disclosed to anonymous internet users.
CWE-209A05:2021 Security Misconfigurationrule: dotnet-custom-errors-off
mediumASP.NET Request Validation Disabledexamples/sample-app/web.config:5CWE-20
validateRequest="false" or requestValidationMode="2.0" turns off the built-in XSS/markup request filter.
examples/sample-app/web.config:5
<pages validateRequest="false"/>               <!-- request validation off (CWE-79) -->
<pages validateRequest="true" />
<httpRuntime requestValidationMode="4.5" targetFramework="4.8" />
Leave request validation enabled (default) and HTML-encode output; scope any exception to a single field.
The framework no longer rejects markup in query/form input, re-opening reflected and stored XSS sinks.
Session theft and account takeover through cross-site scripting on any page that echoes user input.
CWE-20A03:2021 Injectionrule: dotnet-request-validation-disabled
lowBase64/high-entropy value inside a secret-bearing XML tag (SAML AttributeValue, config <value>, etc.)examples/sample-app/config/services.xml:4xml-secret-bearing-tag
Base64/high-entropy value inside a secret-bearing XML tag (SAML AttributeValue, config <value>, etc.)
examples/sample-app/config/services.xml:4
xyz23kdt3uij3430xA9
<value>xyz23kdt3uij3430xA9</value>
rule: xml-secret-bearing-tagentropy: 3.72not checkedsha256: d58f98cbd953fc39…
lowBase64/high-entropy value inside a secret-bearing XML tag (SAML AttributeValue, config <value>, etc.)examples/sample-app/config/services.xml:8xml-secret-bearing-tag
Base64/high-entropy value inside a secret-bearing XML tag (SAML AttributeValue, config <value>, etc.)
examples/sample-app/config/services.xml:8
pk7Hs92jLm4nQr8tVw1zXy
<value>pk7Hs92jLm4nQr8tVw1zXy</value>
rule: xml-secret-bearing-tagentropy: 4.46not checkedsha256: 5b011f3f6a5465ab…