quiz4 110

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/19

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 6:08 AM on 6/2/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

20 Terms

1
New cards

What is the purpose of httpOnly: true?

Prevents JavaScript access to cookies

2
New cards

Which attack attempts to inject malicious SQL statements into a dbms query?

SQL Injection

3
New cards

Which file stores project dependencies?

package.json

4
New cards

What problem could occur here?
app.use ….

The session secret is weak and hence insecure

5
New cards

Whats the primary goal of Cross Site Scripting?

Steal or manipulate user data through injected JavaScript

6
New cards

An application (like our Book Management App) allows user to click “login with Google”…. OAuth login?

Google authenticates the user and sends identity information back to the application.

7
New cards

function ensureAuth (req, res, next) {
…..
res.status

}
What happens if next() is removed from the authenticated branch?

The request may never reach the route handler

8
New cards

What is npm used for?

Package management

9
New cards

In lecture we went over the Book Management App…. Whats the purpose of including this route?

Returns logged in user information based on info included fin the request

10
New cards

Whats the purpose of next() in this middleware?

Passes control to the next middleware?

11
New cards

Whats the potential problem with this code? The code creates a User schema?

This creates the User schema in MongoDB, but the password is stored as raw string and not hashed.

12
New cards

Which of the following is the BEST defense against SQL injection in Node.js applications?

Using prepared statements/parameterized queries

13
New cards

What does this line do?
await.Book.create(req,body)

Book is a schema, and create creates a new MongoDB document.

14
New cards

Whats the security purpose of this line (secret:process.env.SESSION_SECRET)?

Signs and protects session cookies from tampering.

15
New cards

Whats the difference between useState and useEffect in React?
functionApp() {
….
}

useState stores component data while useEffect runs side effects like fetching data

16
New cards

Whats the main reason await is used below?

Waits for a database query to finish

17
New cards

Which attack tricks a logged in user into submitting an unwanted request?

CSRF

18
New cards

Which file stores project dependencies?

19
New cards
20
New cards