Skip to main content

16 security tips for web developers

Web Security

1. Keep softwares up to date

Many developers prefer to use old version of software because they are more familiar with that version. This may cause security breach. So, it is recommended to always stay updated with latest version.

2. Prevent SQL Injection

SQL Injection is one of the most used attack to harm website. SQL Injection can be prevented by using prepared statement or using PDO (PHP Data Object).

In prepared sql statement  a placeholder is used instead of mixing user inserted data in sql statement.


3. Prevent XSS Attack

XSS (Cross-Site Scripting) is use to insert malicious javascript  code to a web page which can be use to steal cookies or other informations from browser.

To prevent this type of attack clean user input before displaying it to webpage.

4. Double form validation

Form validation should be done on both client side and server side. Client side validation is done with javascript which user can manually disable in his/her browser. So, double check is more safe.

5. File uploads

Validation if file uploads should must be implemented. For example if user need to upload his display picture then it should be make sure that he uploads only image files.

6. Encourage users to use a strong password

It is a good practice to encourage user to use a strong password. A strong password included mixture of capital & small alphabets, digits and special character.

7. Good encryption technique for password

Many users use same password for every websites. So if any one of that website's security got compromised then their other account can also be accessed.

8. Turn off form auto fill

Form auto fill is enabled by default. It can be turned off by adding autocomplete="off"
in form tag

9. Prevent direct access of uploads folder

This can be simply approached by adding a index.html file in uploads folder.

10. Install SSL (HTTPS)

Adding 's' in http not only makes it https, it encrypts the communication between point A to point B.  So even if a user is using public wifi, then his log can't be use by any middleware agent.

11. Minimal privilege for directories

Default permission of a directory is 0755 which can be modified according to need.

12. Minimal privilege for database user

Many developers generally grants all permissions for a database which is not a good practice on a development server.

13. Server configuration file

Server configuration file should not be ignored. In Apache Web server '.htaccess', In nginx 'nginx.cong', In Microsoft IIS server 'web.conf' files are server configuration file.
Server configuration file is very powerful. It can be used for many purposes.

14. Hide admin pages

Admin page can be hide from search engines by usgin robotdottxt file. 

15. Custom error message

Always show a custom error message to user instead of  actual error message. For this purpose using error codes is a good idea.


16. Regular backup

Backup should be done regularly and stored offline.

Comments

  1. Nice one sir, every developer should take care of these thinks.

    ReplyDelete
  2. Really I enjoy your site with effective and useful information. It is included very nice post with a lot of our resources.thanks for share. i enjoy this post. best web development usa

    ReplyDelete
  3. Comfortabl y, the post is really the freshest on that deserving topic. I harmonise with your conclusions and definitely will thirstily look forward to your next updates.

    website builder for reseller

    ReplyDelete
  4. This is exceptionally elegantly composed and your focuses are very much communicated. Kindly, absolutely never quit composing.
    white box testing tools

    ReplyDelete
  5. I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. freelance web designer

    ReplyDelete
  6. When your website or blog goes live for the first time, it is exciting. That is until you realize no one but you and your. web design Farmington Hills

    ReplyDelete
  7. I am impressed. I don't think Ive met anyone who knows as much about this subject as you do. You are truly well informed and very intelligent. You wrote something that people could understand and made the subject intriguing for everyone. Really, great blog you have got here. web design

    ReplyDelete
  8. I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. Epik-protocolEPIK

    ReplyDelete

Post a Comment

Popular posts from this blog

Some tools to make life easier

  O ver time, I’ve discovered that the right tools quietly remove friction from everyday work. From managing documents and media to backups, notes, and creative tasks, these applications save time and mental energy. Most are free or open-source, run locally, and respect user control—making them reliable companions for daily digital life. I. Productivity, Notes & Knowledge Management OneNote – Helps organize notes in a structured way using notebooks and sections, making it easier to revisit ideas even after long gaps. Samsung Notes – Works smoothly on Samsung devices and is especially useful for handwritten notes and quick ideas with the S-Pen. Joplin – Stores notes locally in Markdown format, giving full control over data without forcing cloud dependence. Logseq – Encourages thinking in linked ideas rather than isolated notes, which is useful for long-term learning and journaling. Xournal++ – Makes it easy to annotate PDFs and take handwritten notes, especial...

เค†เคฒเคธी เคฒोเค—ों เค•ी เคฆเคธ เคตिเคถेเคทเคคाเคं

  เค•เคˆ เคตเคฐ्เคท เคชเคนเคฒे เคฎैเคจे  เคธोเคšा เคฅा เค•ि เค†เคฒเคธ เคชे เค•ुเค› เคฒिเค–ु, เคฒेเค•िเคจ เคซिเคฐ เค†เคฒเคธ เค•े เค•ाเคฐเคฃ เคฒिเค– เคจเคนीं เคธเค•ा เคฅा। เค†เคœ เค†เคฒเคธी เคต्เคฏเค•्เคคिเคฏों เค•ी เค•ुเค› เคตिเคถेเคทเคคाเค“ं เคธे เค†เคชเค•ो เค…เคตเค—เคค เค•เคฐाเคจे เคœा เคฐเคนा เคนूँ। 1. เคตे เคूเค  เคจเคนीं เคฌोเคฒเคคे เคนै เค†เคฒเคธी เคฒोเค— เคช्เคฐाเคฏ: เคूเค  เคจเคนीं เคฌोเคฒเคคे เคนै। เค‡เคจ्เคนें เคชूเคฐ्เคฃ เคฐूเคช เคธे เคฏเคน เคœ्เคžाเคค เคนोเคคा เคนै เค•ि เคเค• เคूเค  เค•ो เค›िเคชाเคจे เค•े เคฒिเค เค…เคจेเค• เคूเค ों เค•ा เคธเคนाเคฐा เคฒेเคจा เคชเคก़เคคा เคนै, เคœिเคธเคธे เค†เคฒเคธ्เคฏ เค•ा เค…เคธ्เคคिเคค्เคต เค–เคคเคฐे เคฎें เค† เคธเค•เคคा เคนै। เค…เคค: เค‡เคจ เคฒोเค—ो เค•ो เคूเค  เคฌोเคฒเคจे เค•ी เค…เคชेเค•्เคทा เคธเคš เคฌोเคฒเคจा เค…เคงिเค• เคช्เคฐिเคฏ เคนोเคคा เคนै। 2. เคตे เค…เคงिเค• เคตเคซाเคฆाเคฐ เคนोเคคे เคนैं เค—ैเคฐ เค†เคฒเคธी เคฒोเค—ों เค•ी เค…เคชेเค•्เคทा เค†เคฒเคธी เคฒोเค— เค…เคงिเค• เคตเคซाเคฆाเคฐ เคนोเคคे เคนैं। เคœो เคธ्เคค्เคฐी เค…เคชเคจे เคชเคคि เค•े เค†เคฒเคธ्เคฏ  เคธ्เคตเคญाเคต เคธे เคชเคฐिเคšिเคค เคฐเคนเคคी เคนै เคตो เค‰เคจเค•े เคšเคฐिเคค्เคฐ เค•े เคช्เคฐเคคि เคจिเคถ्เคšिंเคค เคฐเคนเคคी เคนै। 3. เคตे เค…เค•ाเคฐเคฃ เค•िเคธी เค•ाเคฐ्เคฏ เค•ो เคœเคŸिเคฒ เคจเคนीं เคฌเคจाเคคे เคนैं เค†เคฒเคธी เคฒोเค— เค†เคธाเคจ เค•ाเคฐ्เคฏ เค•ो เค†เคธाเคจ เคคเคฐीเค•े เคธे เคนी เค•เคฐเคคे เคนै। เคตे เคฌिเคจा เค•ाเคฐเคฃ เค†เคธाเคจ เค•ाเคฐ्เคฏ เค•ो เคœเคŸिเคฒ เคจเคนीं เคฌเคจाเคคे เคนै। 4. เคตे เค•िเคธी เค•ो เคจुเค•เคธाเคจ เคจเคนीं เคชเคนुเคšाเคคे เคนैं เค†เคฒเคธी เคฒोเค— เคช्เคฐाเคฏ: เคธเคฎเคฆเคฐ्เคถी เคนोเคคे เคนै। เคตे เคธเคญी เคœीเคต-เคœंเคคुเค“ं เคฎें เคธ्เคตเคฏं เค•ो เค”เคฐ เคธ्เคตเคฏं เค•ो เคธเคญी เคœीเคต-เคœंเคคुเค“ं เคฎें เคฆेเค–เคคे เคนै। เค…เคค: เคตे เค•िเคธी เคญी เคœीเคต เค•ो เคจुเค•เคธाเคจ เคชเคนुँเคšाเคจे เค•ि เคšेเคท्เคŸा เคจเคนीं เค•เคฐเคคे เคนैं। ...