{"id":23685934,"url":"https://github.com/trandung2k1/sql_injection","last_synced_at":"2026-04-08T20:05:17.585Z","repository":{"id":163541612,"uuid":"636525176","full_name":"trandung2k1/sql_injection","owner":"trandung2k1","description":null,"archived":false,"fork":false,"pushed_at":"2023-05-12T08:45:08.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-12T06:38:51.097Z","etag":null,"topics":["expressjs","mysql","nodejs","security","sql-injection-attacks","sql-server","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trandung2k1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-05-05T03:34:38.000Z","updated_at":"2023-05-12T08:48:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"09224cac-6aaa-4bb2-9129-3936b692dfb1","html_url":"https://github.com/trandung2k1/sql_injection","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/trandung2k1/sql_injection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trandung2k1%2Fsql_injection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trandung2k1%2Fsql_injection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trandung2k1%2Fsql_injection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trandung2k1%2Fsql_injection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trandung2k1","download_url":"https://codeload.github.com/trandung2k1/sql_injection/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trandung2k1%2Fsql_injection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31571619,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["expressjs","mysql","nodejs","security","sql-injection-attacks","sql-server","typescript"],"created_at":"2024-12-29T21:16:23.332Z","updated_at":"2026-04-08T20:05:17.566Z","avatar_url":"https://github.com/trandung2k1.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## SQL Injection\n\nI. Issues queries sql\n\n1.`SELECT * FROM users;-- WHERE id = ${3}` =\u003e `SELECT * FROM users`\n\n```sql\n`SELECT * FROM users;-- WHERE id = ${3}`\n```\n\n2.`SELECT * FROM users WHERE id = 1;-- OR id = 3` =\u003e `SELECT * FROM users WHERE id = 1`\n\n```sql\n`SELECT * FROM users WHERE id = 1;-- OR id = 3`\n```\n\n3.Multiple statements\n\n```sql\n`SELECT * FROM users WHERE id = 1; UPDATE users SET name = 'DungU' WHERE id = 1`\n```\n\nII. Fix issues sql injection\n\n1.Don’t allow multiple statements\n\n```js\nconst conn = mysql.createConnection({\n    host: 'host',\n    user: 'username',\n    database: 'database_name',\n    multipleStatements: false,\n});\n```\n\n2.Use placeholders instead of variable interpolation\n\n```sql\n`SELECT * FROM users WHERE id = ?`\n```\n\n3. Input validation\n4. Allowlisting\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrandung2k1%2Fsql_injection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrandung2k1%2Fsql_injection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrandung2k1%2Fsql_injection/lists"}