symfony 批处理操作安全性

发布于 2024-12-23 05:28:29 字数 845 浏览 2 评论 0原文

我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

赢得她心 2024-12-30 05:28:29

我尝试了你的设置,但我对这种意想不到的行为感到好奇。所以我在代码中冲浪,最后我发现为了确保 batchDelete 操作的安全,我们必须以这种方式将设置放在 generator.yml 中,config 下> actions

config:
  actions:
    batchDelete:
      credentials: [user_permission]

显然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 the generator.yml in this way, under config > actions:

config:
  actions:
    batchDelete:
      credentials: [user_permission]

Obiviously user_permission is delete_ticker_source for you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文