Skip to content

Commit c907dad

Browse files
[pre-commit.ci lite] apply automatic fixes
1 parent 7f05a3e commit c907dad

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div id="database-challenge-container" style="border: 1px solid #ccc; border-radius: 8px; padding: 20px; margin: 20px; background-color: #f9f9f9;">
22
<h4>🗄️ Database Connection Error Demo</h4>
33
<p>This challenge demonstrates how database connection failures can expose sensitive credentials through error messages.</p>
4-
4+
55
<div style="background: #fff3cd; border: 1px solid #ffeaa7; border-radius: 6px; padding: 15px; margin: 15px 0;">
66
<p><strong>Try the vulnerable endpoint:</strong></p>
77
<p>Click the button below to trigger a database connection error that exposes the connection string with embedded credentials.</p>
@@ -10,8 +10,8 @@
1010
</a>
1111
<p style="margin-top: 10px;"><small style="color: #666;">This endpoint simulates a database connection failure that exposes the connection string with embedded credentials.</small></p>
1212
</div>
13-
13+
1414
<div style="margin-top: 15px; font-size: 12px; color: #666;">
1515
💡 Tip: Look for the database password in the error message or application logs.
1616
</div>
17-
</div>
17+
</div>

src/test/e2e/cypress/integration/challenge58.cy.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ describe('Challenge 58 Database Connection String Exposure Tests', () => {
6666
it('Can solve the challenge using the exposed database password', () => {
6767
// First, trigger the database error to find the secret
6868
cy.get(ERROR_DEMO_LINK).click()
69-
69+
7070
// Wait for error page and extract the secret
7171
cy.get('body', { timeout: 10000 }).should('contain', 'SuperSecretDB2024!')
72-
72+
7373
// Navigate back to the challenge page
7474
cy.visit('/challenge/challenge-58')
75-
75+
7676
// Use the secret to solve the challenge
7777
cy.dataCy(ChallengesPage.ANSWER_TEXTBOX).type('SuperSecretDB2024!')
7878
cy.dataCy(ChallengesPage.SUBMIT_TEXTBOX_BTN).click()
@@ -120,7 +120,7 @@ describe('Challenge 58 Database Connection String Exposure Tests', () => {
120120

121121
// Access the error endpoint
122122
cy.visit('/error-demo/database-connection')
123-
123+
124124
// Verify error content contains realistic database connection information
125125
cy.get('body').should(($body) => {
126126
const text = $body.text()
@@ -136,14 +136,14 @@ describe('Challenge 58 Database Connection String Exposure Tests', () => {
136136

137137
// Most importantly, verify the credentials are exposed
138138
cy.get('body').should('contain', 'SuperSecretDB2024!')
139-
139+
140140
cy.log('Educational objective achieved: Database credentials exposed through error handling demonstrate real-world vulnerability')
141141
})
142142

143143
it('Error endpoint demonstrates common logging/error disclosure patterns', () => {
144144
// Test that the error endpoint demonstrates realistic error disclosure
145145
cy.visit('/error-demo/database-connection')
146-
146+
147147
// Check for common error patterns that expose secrets
148148
cy.get('body').should(($body) => {
149149
const content = $body.text()
@@ -160,9 +160,9 @@ describe('Challenge 58 Database Connection String Exposure Tests', () => {
160160
// Verify the challenge provides educational context
161161
cy.get(DATABASE_CONTAINER).should('contain', 'database connection failures can expose sensitive credentials')
162162
cy.get(DATABASE_CONTAINER).should('contain', 'Look for the database password')
163-
163+
164164
// Verify the demo section explains the vulnerability
165165
cy.get(DATABASE_CONTAINER).should('contain', 'Click the button below to trigger a database connection error')
166166
cy.get(DATABASE_CONTAINER).should('contain', 'exposes the connection string with embedded credentials')
167167
})
168-
})
168+
})

0 commit comments

Comments
 (0)