I am trying to get the IP address and send it to my rails server as a parameter of a POST request. Is this action safe?
-
4more context...what is the IP address for? I dont see why it would be unsafe, if you are unsure just send it via https? – TheHidden Nov 03 '16 at 22:37
-
it depends on what you then want to do with that address (and also what address it is), so yeah, much more details are needed – Gabor Lengyel Nov 03 '16 at 22:40
-
Im sending the IP Address of a mobile device to the rails server. Not sure if it is a secure practice? – cengo Nov 03 '16 at 22:41
-
2can you elaborate what you want to achieve by this? – Out of Band Nov 03 '16 at 23:36
-
Safe against what? – Marcel Nov 04 '16 at 07:06
2 Answers
There's no utility on sending IP address of local device, on which you app is running. There're good chances that you'll get only local ip-address from the device, which is hardly useful. Moreover, in the days of dynamic public IP address assignment from ISPs, IP addresses are hardly used for monitoring or tracking purpose(As there're good chances that public IP address assigned to you by your ISP, may be assigned to some other computer, at another time).

- 289
- 3
- 11
To ensure that the data is 'safely' POSTed to your server such that it remains confidential and is not tampered with by an attacker in transit, use transport layer security (TLS).
To ensure that your application 'safely' processes the POSTed data, validate that data prior to use to ensure it is what you expect to receive i.e an IP Address.

- 256
- 1
- 5