-
Notifications
You must be signed in to change notification settings - Fork 2
fix: parameterize product search query to close UNION SQL injection bug #338
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -689,7 +689,8 @@ | |
| 2, | ||
| 6, | ||
| 7, | ||
| 8 | ||
| 8, | ||
| 9 | ||
| ] | ||
| }, | ||
| "directoryListingChallenge_1_correct.ts": { | ||
|
|
@@ -1267,7 +1268,9 @@ | |
| }, | ||
| "unionSqlInjectionChallenge_1.ts": { | ||
| "added": [], | ||
| "removed": [] | ||
| "removed": [ | ||
| 6 | ||
| ] | ||
|
Comment on lines
+1271
to
+1273
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 RSN cache preserves stale codefixes Locking the new Learn moreThe RSN compares each live vulnerability snippet with its codefix variants. The changed cache records the new divergence instead of updating those variants. The live snippet is already parameterized but remains tagged as the vulnerable line, so Find It asks learners to identify a flaw that is absent. Both marked-correct files place Example: A learner opens User Credentials Fix It after selecting the tagged line. The accepted option changes a search for Recommended fix: Follow the repository's RSN workflow: manually update all Was this helpful? React with 👍 or 👎 to provide feedback. |
||
| }, | ||
| "unionSqlInjectionChallenge_2_correct.ts": { | ||
| "added": [ | ||
|
|
@@ -1285,7 +1288,8 @@ | |
| 6, | ||
| 7, | ||
| 8, | ||
| 9 | ||
| 9, | ||
| 10 | ||
| ] | ||
| }, | ||
| "weakPasswordChallenge_1_correct.ts": { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Three advertised challenges become dysfunctional
Once
searchProductsparameterizescriteria, User Credentials and Database Schema can never satisfy their only solver checks. Christmas Special also loses its in-application path for discovering the deleted product. All three remain enabled on the scoreboard.Learn more
The User Credentials and Database Schema solvers inspect the returned search rows for all user credentials or all SQLite definitions. A literal search term cannot produce either dataset, so those challenge states never advance. Christmas Special relies on the same injectable search to reveal a paranoid-deleted product before adding it to a basket; its completion check still exists in placeOrder, but the supported discovery path is gone. The challenge catalog still defines all three without an applicable disablement, so they continue to appear as available exercises.
Example: A learner submits the documented
')) UNION SELECT ... FROM Users--payload. The endpoint returns an empty list, User Credentials remains unsolved, and the scoreboard still presents it as completable.Recommended fix: Remove or explicitly disable the affected challenge definitions, dependencies, snippets, and scoreboard entries when shipping the secured search. If these challenges must remain, move each intended vulnerability and solver to a dedicated training-only path and retain corresponding E2E coverage.
Was this helpful? React with 👍 or 👎 to provide feedback.