提问人:Mikopet 提问时间:10/27/2015 最后编辑:Mikopet 更新时间:11/1/2015 访问量:401
Symfony学说有sql注入失败?
Symfony doctrine had an sql injection failure?
问:
我在symfony 3中做了一个小项目,并运行了 detectify.com。 正如detectify所说,我有“MySQL中的盲目SQL注入”风险
我有Postgres,但没关系。扫描后,我在表中的键升级到 700。但这里没有数据。 所以,我有安全风险。
控制器:
public function bidAction($category = null, Request $request)
{
$bid = new Bids();
$bid->setCategory($category);
$bid->setDate(new \DateTime('now'));
$form = $this->createFormBuilder($bid)
->add('notes', 'textarea', array('label' => 'Message'))
->add('email', 'email')
->add('save', 'submit', array('label' => 'Write your bid'))
->getForm();
$form->handleRequest($request);
if ($form->isValid() && $form->isSubmitted()) {
$em = $this->getDoctrine()->getManager();
$em->persist($bid);
$em->flush();
return $this->redirectToRoute('mikola_studio_main_bid_category', array('category'=>'success'));
}
return $this->render('MikolaStudioMainBundle:Default:bid.html.twig',
array(
'category' => $category,
'form' => $form->createView(),
'unique'=>false, // for template
'sidebar'=>true // for template
));
}
我有信心,坚持教义免受SQL注入的保护 我现在很失望
实体:
/**
* @var string
*
* @ORM\Column(name="notes", type="text")
*/
private $notes;
/**
* @var string
*
* @Assert\Email(
* message = "The ({{ value }}) is not valid!",
* checkMX = true
* )
* @ORM\Column(name="email", type="string", length=255)
*/
private $email;
树枝:
{{ form_start(form) }}
{{ form_errors(form) }}
{{ form_row(form.notes) }}
{{ form_row(form.email) }}
<footer>{{ form_row(form.save, {'attr': {'class': 'button icon fa-shopping-cart'}}) }}</footer>
{{ form_end(form) }}
detectify 请求正文:
form%5Bnotes%5D=&form%5Bemail%5D=If(%40x%2c0%2c(SeleCT(%40x%3a%3dSleeP(0.1)--1)))%2f*%27Or(If(%40x%2c0%2c(SeleCT(%40x%3a%3dSleeP(0.1)--1))))Or%27%22or(If(%40x%2c0%2c(SeleCT(%40x%3a%3dSleeP(0.1)--1))))Or%22*%2f&form%5Bsave%5D=
读:
form[notes]=&form[email]=If(@x,0,(SeleCT(@x:=SleeP(0.1)--1)))/*'Or(If(@x,0,(SeleCT(@x:=SleeP(0.1)--1))))Or'"or(If(@x,0,(SeleCT(@x:=SleeP(0.1)--1))))Or"*/&form[save]=
答: 暂无答案
评论
detectify.com