Tygari Posted October 10, 2020 Posted October 10, 2020 I am writing my own web game as I learn web programming. For the next version I am moving most the code to a server. This is the first time I am writing a server from scratch. Using a Node server with Express and Sockets stacked in as the frame work. What are tricks I can use to prevent malicious players from hacking the server? Right now I am enclosing all incoming data in {} brackets and nothing gets ran without a 'typeof' verification that it is of the correct datatype. No functions are being passed as data types so anything that returns as a typeof == 'function' gets scrapped. Only after code that passes all my verifications and gets through proper processing returning the correct type of data gets transferred out of the {} fields.
Kirstenwilliamson23 Posted December 14, 2021 Posted December 14, 2021 Oh that's incredible. I always have the affinity for people who go out of their way to give the people what they want in terms of a great gaming experience. Good for you man, and I cant wait to see your game seen in the best places where I can buy it for any platform that I own or will buy just to play your video game.
MaureenHaynes Posted May 5, 2023 Posted May 5, 2023 On 10/11/2020 at 1:11 AM, Tygari said: I am writing my own web game as I learn web programming. For the next version I am moving most the code to a server. This is the first time I am writing a server from scratch. Using a Node server with Express and Sockets stacked in as the frame work. What are tricks I can use to prevent malicious players from hacking the server? Right now I am enclosing all incoming data in {} brackets and nothing gets ran without a 'typeof' verification that it is of the correct datatype. No functions are being passed as data types so anything that returns as a typeof == 'function' gets scrapped. Only after code that passes all my verifications and gets through proper processing returning the correct type of data gets transferred out of the {} fields. GTA 5 Mobile Free Download tips to help prevent malicious players from hacking your server: Input Validation: It's important to validate all user input before processing it on the server. This can include checking for the correct data type, length, and format of input. You can use libraries like Joi or Validator.js to make input validation easier. Use HTTPS: Use HTTPS instead of HTTP to secure the communication between the client and the server. This will encrypt the data that is being transmitted, making it harder for attackers to intercept or modify it. Implement Rate Limiting: Implement rate limiting to prevent users from sending too many requests to your server in a short period of time. This can help prevent denial of service (DoS) attacks. Use Authentication and Authorization: Use authentication and authorization to ensure that only authorized users can access your server. You can use libraries like Passport or OAuth to make authentication and authorization easier. Use Secure Cookies: Use secure cookies to store user authentication tokens and prevent session hijacking. Make sure to set the secure and httpOnly flags on your cookies. Keep Your Server Up-to-Date: Keep your server and all of its dependencies up-to-date to ensure that you are protected against known vulnerabilities. Use Security Headers: Use security headers like Content-Security-Policy, X-Content-Type-Options, and X-XSS-Protection to provide an additional layer of protection against common web application attacks like cross-site scripting (XSS) and clickjacking.
Rkiver Posted May 5, 2023 Posted May 5, 2023 Oh look more chatgpt answers for something years old....
Recommended Posts
Archived
This topic is now archived and is closed to further replies.