Skip to content

Update app.js#5

Open
tvalverd wants to merge 1 commit intomainfrom
tvalverd-patch-3
Open

Update app.js#5
tvalverd wants to merge 1 commit intomainfrom
tvalverd-patch-3

Conversation

@tvalverd
Copy link
Owner

No description provided.

app.get('/', (req, res) => res.send('Hello World!'))
app.get('/foo/:id', (req, res) => {
res.send('Hello world!')
eval('console.log("something", ' + req.params.id + ')')

Check failure

Code scanning / CodeQL

Code injection

This code execution depends on a [user-provided value](1).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Micro-Learning Topic: Code injection (Detected by phrase)

Matched on "Code injection"

What is this? (2min video)

Code injection happens when an application insecurely accepts input that is subsequently used in a dynamic code evaluation call. If insufficient validation or sanitisation is performed on the input, specially crafted inputs may be able to alter the syntax of the evaluated code and thus alter execution. In a worst case scenario, an attacker could run arbitrary code in the server context and thus perform almost any action on the application server.

Try a challenge in Secure Code Warrior

Helpful references

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Micro-Learning Topic: SQL injection (Detected by phrase)

Matched on "SQL injection"

What is this? (2min video)

This is probably one of the two most exploited vulnerabilities in web applications and has led to a number of high profile company breaches. It occurs when an application fails to sanitize or validate input before using it to dynamically construct a statement. An attacker that exploits this vulnerability will be able to gain access to the underlying database and view or modify data without permission.

Try a challenge in Secure Code Warrior

Helpful references

Repository owner deleted a comment from secure-code-warrior-for-github bot Aug 29, 2023
Repository owner deleted a comment from secure-code-warrior-for-github bot Aug 30, 2023
Repository owner deleted a comment from secure-code-warrior-for-github bot Aug 30, 2023
@tvalverd
Copy link
Owner Author

CWE-22 Check

@secure-code-warrior-for-github

Micro-Learning Topic: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (CWE 22)

Matched on "CWE-22"

What is this? (2min video)

The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as ".." that can resolve to a location that is outside of that directory.

Try a challenge in Secure Code Warrior

Helpful references
  • OWASP Input Validation Cheat Sheet - This cheatsheet is focused on providing clear, simple, actionable guidance for preventing injection and input validation flaws in your applications, including defence against path traversal.
  • OWASP Path Traversal - OWASP community page with comprehensive information about path traversal, and links to various OWASP resources to help detect or prevent it.

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