Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to access environment variables in html file?

Tags:

html

I was just wondering if i access system variables (like PATH settings or other environment variables) and display it using html page! Is it possible? Or is there any methos to acheive this?
I have been wondering about this from a long time!

like image 869
Destructor Avatar asked Oct 21 '13 13:10

Destructor


2 Answers

No, you can't. HTML5 itself is just a markup language for web content. It has no active components.

You likely assume that there might be something among the new Javascript features which are incorrectly grouped under the label HTML5 (it often seems to me like HTML5 should rather be advertised as Javascript 5, because most of its features are rather for Javascript programmers than for pure webdesigners). But I also have to disappoint you there.

Reading environment variables from the users system has little to no useful application in the context of web applications, but plenty of abuse potential. It could be used to fingerprint the user, collect sensitive information and could be used in conjecture with other exploits to better target them. So no API for doing that was ever recommended by the W3C as far as I know.

like image 111
Philipp Avatar answered Sep 29 '22 04:09

Philipp


Since HTML is a markup language it is not possible. Javascript oder other client side things could access system variables through either provided API of the runtime (part of the browser).

like image 28
Tobi Avatar answered Sep 29 '22 05:09

Tobi