python - Flask: fork 环境

标签 python flask

Flask-Quick Start 浏览 Flask 文档时我看到了以下段落。

Attention

Even though the interactive debugger does not work in forking environments (which makes it nearly impossible to use on production servers), it still allows the execution of arbitrary code. This makes it a major security risk and therefore it must never be used on production machines.

我搜索了 stackoverflow、google,但我无法找到这些“ fork 环境”是什么,以及它们如何允许执行任意代码。如果有人能给我指出正确的方向,那就太好了!

最佳答案

前面的句子是这样的:

If you enable debug support the server will reload itself on code changes, and it will also provide you with a helpful debugger if things go wrong.

正是这个有用的调试器允许执行任意代码;它通过网络接受 Python 代码,并可以在您的服务器上为您执行该任意代码。

它说,不要在生产服务器上启用 Debug模式。

关于 fork 环境的部分只是告诉您提供的调试器在进程 fork 时不起作用(例如,使用多个进程处理请求),但您不应该误以为安全。即使调试器在此类环境中出现故障,它的故障也不足以禁用 Python 执行功能。

关于python - Flask: fork 环境,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21558463/

相关文章:

python - 时间序列问题的自动特征生成 - Featuretools

python - .doc 到 pdf 使用 python

python - 来自flask的响应在React前端收到的Json上有额外的键

python - 使用循环将大数据写入 Excel 列单元格

python - Django Rest Framework - 将多对多字段属性序列化为 POST 操作

python - 有没有办法检查用户和通行证在 python 3 中的 gmail 中是否有效?

flask - 使用 Flask-Mail 发送邮件时连接被拒绝

python - WTForms-如何预填充文本区域字段?

python - 一台服务器,2个站点,1个用 Varnish 缓存,另一个不能删除 session

flask - 将上下文传递给 Jinja 模板中包含的 Jinja 模板