Now there is a SQL like this:
SELECT * FROM member
WHERE username
= params LIMIT 1
params is a variable entered by the user, supposeI know all the database table fields and can only execute one SQL statement (executed by the ORM of the project), how to fill in the value of params will become a SQL that is harmful to the database/data table/table data
当前位置:网站首页>What can be done to make this SQL into a dangerous SQL?
What can be done to make this SQL into a dangerous SQL?
2022-08-01 23:20:00 【segmentfault】
Other Answer 1:
SELECT * FROM member WHERE username = "params" LIMIT 1
params = '" or (delete * from member) or username="';
The flattening becomesSELECT * FROM member WHERE username = "" or (delete * from member) or username="" LIMIT 1
But this is a theoretical situation. In fact, most frameworks have some built-in processing, which is not so easy to inject. For example, double quotes in variables are automatically escaped, so that it becomes SELECT * FROM member WHERE username= "\" or (delete * from member) or username=\"" LIMIT 1
, then it's harmless.
In simple terms, don't spell SQL yourself, but use the methods provided by the object to deal with it.Isn't php generally $query->from('member')->where('username', params)->fetch()
.
Other Answers 2:
SQL injection, use precompile to solve
边栏推荐
- SRv6 L3VPN的工作原理
- Small application project works WeChat stadium booking applet graduation design of the finished product (1) the development profile
- Chapter 12 End-User Task As Shell Scripts
- JAX-based activation function, softmax function and cross entropy function
- 6132. 使数组中所有元素都等于零-快速排序法
- Postman batch test interface detailed tutorial
- bat 之 特殊字符&转义
- 测试岗月薪5-9k,如何实现涨薪到25k?
- Chapter 11 Working with Dates and Times
- 软技能之UML图
猜你喜欢
From 0 to 1: Design and R&D Notes of Graphic Voting Mini Program
复现gallerycms字符长度限制短域名绕过
Codeforces CodeTON Round 2 (Div. 1 + Div. 2, Rated, Prizes!) A-D Solution
系统可用性:SRE口中的3个9,4个9...到底是个什么东西?
Background project Express-Mysql-Vue3-TS-Pinia page layout-sidebar menu
软技能之UML图
How do programmers solve online problems gracefully?
Codeforces CodeTON Round 2 (Div. 1 + Div. 2, Rated, Prizes!) A-D 题解
解决yolov5训练时出现:“AssertionError: train: No labels in VOCData/dataSet_path/train.cache. Can not train ”
研发团队数字化转型实践
随机推荐
对于在新标签页中打开的链接,始终使用“noopener”或“noreferrer”
Is TCP reliable?Why?
深度学习基础-基于Numpy的循环神经网络(RNN)实现和反向传播训练
C language - branch statement and loop statement
JS prototype hasOwnProperty in Add method Prototype end point Inherit Override parent class method
SQL Server (design database--stored procedure--trigger)
JAX-based activation function, softmax function and cross entropy function
UML diagram of soft skills
如何使用pywinauto和pyautogui将动漫小姐姐链接请回家
【C补充】链表专题 - 单向链表
Getting started with IDEA is enough to read this article
数据库表设计规则
论文解读(GSAT)《Interpretable and Generalizable Graph Learning via Stochastic Attention Mechanism》
y84.第四章 Prometheus大厂监控体系及实战 -- prometheus告警机制进阶(十五)
excel remove all carriage return from a cell
cmd指令
访问控制台中的选定节点
CF1705D Mark and Lightbulbs
Error creating bean with name ‘dataSource‘:Unsatisfied dependency expressed through field ‘basicPro
分享10套开源免费的高品质源码,免费源码下载平台