require_once() 被 open_basedir 阻止 - 那么如何保证系统安全?

发布于 2024-10-28 05:59:02 字数 330 浏览 3 评论 0原文

我有一个包含大量重要数据并关心安全性的网站,现在我必须在那里运行一些潜在不安全的代码(Joomla)。我想通过 open_basedir “封闭”整个目录树,同时我不想隐藏数据库密码 - 所以我想将数据库密码移出 open_basedir 树(以及一些可以连接的功能)到数据库,以便调用者本身无法获得密码)。但有一个问题 - 当 open_basedir 运行时 require_once 也不起作用!

有什么方法可以设置 open_basedir 并允许 require_once 吗?

有没有其他方法可以调用 open_basedir 有限区域之外的一些秘密 php 代码?

请帮忙。提前致谢!

I have a website with a lot of important data and care about security, and now I must run there some potentially unsafe code (Joomla). I want to "enclose" this whole directory tree by open_basedir, and at the same time I wan't to hide database password from it - so I want to move the database password OUT of the open_basedir tree (along with some functionality which would connect to the database, so that the caller doesn't get the password itself). But there is a problem - require_once also doesn't work when open_basedir is in action!!!

Is there any way how to set up open_basedir and allow require_once?

Is there any other way how to call some SECRET php code OUT of the open_basedir limited area?

Please help. Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

夜灵血窟げ 2024-11-04 05:59:02

当 open_basedir 运行时,require_once 也不起作用

是的,它起作用,除非您试图包含 basedir 之外的文件。然后它会像其他任何试图到达 basedir 之外的东西一样失败。

还有其他方法可以调用 open_basedir 有限区域之外的一些秘密 php 代码吗?

如果定义了 basedir,就无法摆脱它。如果您发现一个错误,则它是一个错误,必须立即消除。

require_once also doesn't work when open_basedir is in action

Yes it does, unless you're trying to include a file outside of the basedir. Then it'd fail like anything else that tries to reach outside of the basedir.

Is there any other way how to call some SECRET php code OUT of the open_basedir limited area?

There is no way out of a basedir if you have it defined. If you find one, it is a bug and must be squashed immediately.

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