How can I protect my php, jquery, ajax requests from hackers?

Malli

I send a lot of data through jquery's ajax method, an example of a function is

$.ajax({
    url: retrive.php,
    type:     'POST',
    data:     data,
    success:  callback
});

The problem is that anyone can look at the source and see that the location of the php file its sending the POST data to, therefore you could just point your browser there and get data from the URL. I do checks on the data to make sure its the right data type, but I dont want users to be able to go to the url at all.

How can we protect against direct access of that url?

Charles John Thompson III

There is no way to keep a user from navigating to the url show in your AJAX request. All you can do is show an error if you don't receive POST data. You could possibly also set a custom request header with the AJAX request to check for as well.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can I protect my site from the multiple post requests?

From Dev

How can I protect my site from the multiple post requests?

From Dev

Can I hash/encrypt or otherwise protect emails in my Django app from hackers?

From Dev

How can I protect my user passwords and passphrase from root

From Dev

How can I protect my .factory from minification?

From Dev

How can I protect my OLED screen from burn-in?

From Dev

How can i keep my code dry in ajax requests?

From Dev

How can I protect my robot code?

From Dev

How can I forward jquery requests from my server directly to another?

From Java

How can I forward requests from my web server?

From Dev

How can I protect my WebAPI from abuse and avoid sharing API keys?

From Dev

How can I protect my data from certain apps in Windows 7?

From Dev

How can I protect my Linux system from future ramsomware's attack?

From Dev

How to send secure AJAX requests with PHP and jQuery

From Dev

How can I protect my Kloudless API Key and Account ID?

From Dev

How can I protect my Kloudless API Key and Account ID?

From Dev

How can I make my AJAX url depend on a jquery condition?

From Dev

How to get "data" from JQuery Ajax requests

From Dev

How can I check in my jquery if the return value from php is 'true' or 'false'?

From Dev

Can I rely on the order of responses from jQuery.when on multiple Ajax requests

From Dev

Can I rely on the order of responses from jQuery.when on multiple Ajax requests

From Dev

How to protect one method from different requests

From Dev

How can I execute requests on my Microsoft Azure Database from my Android app

From Dev

How can i call a PHP Query using JQuery and Ajax?

From Dev

How can I remove the .php extension from my PHP page?

From Dev

How can I protect a matrix in R from being altered by Rcpp?

From Dev

How can I protect integer data on NSUserDefaults from hacking?

From Dev

How can I protect sqlite db in android from being stolen

From Dev

How can i restrict protect_from_forgery with exception rails

Related Related

  1. 1

    How can I protect my site from the multiple post requests?

  2. 2

    How can I protect my site from the multiple post requests?

  3. 3

    Can I hash/encrypt or otherwise protect emails in my Django app from hackers?

  4. 4

    How can I protect my user passwords and passphrase from root

  5. 5

    How can I protect my .factory from minification?

  6. 6

    How can I protect my OLED screen from burn-in?

  7. 7

    How can i keep my code dry in ajax requests?

  8. 8

    How can I protect my robot code?

  9. 9

    How can I forward jquery requests from my server directly to another?

  10. 10

    How can I forward requests from my web server?

  11. 11

    How can I protect my WebAPI from abuse and avoid sharing API keys?

  12. 12

    How can I protect my data from certain apps in Windows 7?

  13. 13

    How can I protect my Linux system from future ramsomware's attack?

  14. 14

    How to send secure AJAX requests with PHP and jQuery

  15. 15

    How can I protect my Kloudless API Key and Account ID?

  16. 16

    How can I protect my Kloudless API Key and Account ID?

  17. 17

    How can I make my AJAX url depend on a jquery condition?

  18. 18

    How to get "data" from JQuery Ajax requests

  19. 19

    How can I check in my jquery if the return value from php is 'true' or 'false'?

  20. 20

    Can I rely on the order of responses from jQuery.when on multiple Ajax requests

  21. 21

    Can I rely on the order of responses from jQuery.when on multiple Ajax requests

  22. 22

    How to protect one method from different requests

  23. 23

    How can I execute requests on my Microsoft Azure Database from my Android app

  24. 24

    How can i call a PHP Query using JQuery and Ajax?

  25. 25

    How can I remove the .php extension from my PHP page?

  26. 26

    How can I protect a matrix in R from being altered by Rcpp?

  27. 27

    How can I protect integer data on NSUserDefaults from hacking?

  28. 28

    How can I protect sqlite db in android from being stolen

  29. 29

    How can i restrict protect_from_forgery with exception rails

HotTag

Archive