Symfony条令有sql注入失败?

Symfony条令有sql注入失败?,symfony,doctrine-orm,sql-injection,Symfony,Doctrine Orm,Sql Injection,我在symfony 3上做了一个小项目,并在上面运行了detectify.com。 正如detectify所说,我有“MySQL中盲目SQL注入”的风险 我有博士后,但没关系。扫描后,我在表中的密钥增加到700。但这里没有数据。 苏欧,我有安全隐患 控制员: public function bidAction($category = null, Request $request) { $bid = new Bids(); $bid->setCategory($catego

我在symfony 3上做了一个小项目,并在上面运行了detectify.com。 正如detectify所说,我有“MySQL中盲目SQL注入”的风险

我有博士后,但没关系。扫描后,我在表中的密钥增加到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[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]= 

SQL注入是一个严重的问题,但我认为这里有一个误报。如果您没有在应用程序代码中弄乱任何东西(例如,使用未转移的负载发布原始SQL查询),默认情况下,原则是相当安全的。我不知道这个
detectify.com
服务,但是有很多这样的服务,其中大多数都用术语“scareware”来描述。无论如何,警告是否表明条令/符号的哪些特定部分存在风险?这个工具能显示精确的攻击向量吗?不,不说。但是在我的DB表中,我看到,新记录不是从正常id开始的(自动递增),而是从+700开始的!!o、 所以我认为detectify可以写700条记录(不是什么大东西),并且可以删除它们!(这是一件大事)请求正文:表单%5Bnotes%5D=&表单%5Bemail%5D=If(%40x%2c0%2c(选择(%40x%3a%3dSleeP(0.1)---1))%2f*%27或者(如果(%40x%2c0%2c(选择(%40x%3a%3dSleeP(0.1)---1))或者%27%22*%2f&表单%5Bsave%5D=detectify网站说你可以得到一份容易理解的报告。请用实际报告更新您的问题。并将请求正文移到您的问题中,使其可读。@Mikopet:您能尝试“重放”攻击吗?这会给你什么结果?有错误或成功消息吗?
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%2c‌​0%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]=