symfony 批处理操作安全性
我的 security.yml
:
all:
is_secure: true
new:
credentials: [add_ticker_source]
edit:
credentials: [edit_ticker_source]
delete:
credentials: [delete_ticker_source]
batchDelete: //I don't know whether it is correct. Should it be batch_delete?
credentials: [delete_ticker_source]
batch_delete:
credentials: [delete_ticker_source]
index:
is_secure: false
在我的 generator.yml
中,我添加了
list:
batch_actions:
_delete: {credentials: delete_ticker_source}
然后注释了最后两行并在浏览器中打开了列表视图。因此,在浏览器的列表视图中,我可以在批处理操作的下拉列表中看到删除。现在,我取消了它们的注释并且没有刷新浏览器。我从列表视图中选择了一些元素,在批量下拉列表中选择了删除,然后点击go
。这些项目会立即被删除。这是否意味着批量删除不安全?或者有人可以通过嗅探来删除吗?
我什至尝试在取消注释后清除缓存,但随后元素也被删除。
PS:不,我登录的用户没有 delete_ticker_source
凭据(如网络调试栏所示)。
my security.yml
:
all:
is_secure: true
new:
credentials: [add_ticker_source]
edit:
credentials: [edit_ticker_source]
delete:
credentials: [delete_ticker_source]
batchDelete: //I don't know whether it is correct. Should it be batch_delete?
credentials: [delete_ticker_source]
batch_delete:
credentials: [delete_ticker_source]
index:
is_secure: false
in my generator.yml
, I added
list:
batch_actions:
_delete: {credentials: delete_ticker_source}
then I commented last two lines and opened list view in my browser. So in my list view in the browser, I can see delete in the drop-down of batch actions. Now, I uncommented them and didn't refresh the browser. I selected some elements from the list view, selected delete in the batch drop-down and hit go
. These items get deleted instantly. Does that mean batch delete is not secure?? Or could anyone delete by sniffing around??
I even tried clearing cache after uncommenting but then also, the elements are deleted.
P.S. : and no, the user I'm logged in with, does not have delete_ticker_source
credentials(as told by web debug bar).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我尝试了你的设置,但我对这种意想不到的行为感到好奇。所以我在代码中冲浪,最后我发现为了确保
batchDelete
操作的安全,我们必须以这种方式将设置放在generator.yml
中,config 下> actions:显然
user_permission
对你来说是delete_ticker_source
。I tried your settings and yet I'm wonder of this unexpected behaviour. So I surfed inside the code and finally I found that to secure the
batchDelete
action we have to put the setting inside thegenerator.yml
in this way, under config > actions:Obiviously
user_permission
isdelete_ticker_source
for you.