2

I have a written an app, with python acting as a simple web server (I am using bottle framework for this) and an HTML + JS client. The whole thing runs locally. The web page acts as GUI in this case.

In my code I have implemented a file browser interface so I can access local file structure from JavaScript.

The server accepts only local connections, but what bothers me is that: if for example somebody knows that I am running my app locally, and forges a site with AJAX request to localhost? and I visit his site in some way, will my local files be visible to the attacker?

My main question is: is there any way to secure this? I mean that my server will know for sure that the request came from my locally served file?

4

1 に答える 1

1

この攻撃から保護する最も直接的な方法は、すべての要求に必要な長くて複雑な秘密鍵を用意することです。リクエストを処理する前に、ローカル コード自体を認証するだけです。これは基本的に、インターネット上の Web サービスを保護する方法です。

また、DBUS や UNIX ソケットなどの他の形式でプロセス間通信を行うことを検討することもできます。どのOSを使用しているかはわかりませんが、プロセス間通信には、このように脆弱にならない多くのオプションがあります.

于 2012-12-09T15:47:39.237 に答える