Tagged articles
input validation
62 articles · Page 1 of 1
This article details five critical PHP weak typing vulnerabilities — loose equality, empty() misuse, in_array/switch type juggling, and 0e hash collisions — and provides production-ready secure comparison templates, strict input validation functions, and a pre-deployment checklist to prevent authentication bypasses and data corruption.
PHPSecuritydeclare strict_types
0 likes · 6 min read

This article explains how PHP's loose comparison (==) leads to security vulnerabilities and data corruption in production due to malformed input, detailing three common scenarios—permission bypass, zero-value misjudgment, and in_array/switch bypass—and provides strict comparison, input validation, and hash_equals best practices to prevent such bugs.
Best PracticesPHPinput validation
0 likes · 7 min read

This tutorial walks through two Java examples—a simple user login verification program and a basic sensitive‑word filtering utility—explaining the problem setup, code logic, and sample outputs to illustrate input validation and string processing techniques.
JavaProgramming TutorialSensitive Word Filtering
0 likes · 8 min read

This article explains the Scanner class in java.util, outlines a four‑step usage pattern, details its API for reading and validation, addresses the common nextInt/nextLine line‑skip issue with two reliable solutions, and provides best‑practice guidelines and example code to avoid resource leaks and input errors.
Best PracticesConsole InputException Handling
0 likes · 10 min read


ITPUBApr 6, 2026 · Backend Development
The article explains how treating the literal string "null" as an empty value can cause serious bugs in Java backend registration, database storage, and security checks, and provides concrete code examples and a sanitisation utility to prevent these issues.
BackendNULL handlinginput validation
0 likes · 7 min read

Zero‑width characters are invisible Unicode symbols that can silently break form validation, URL parsing, and data storage in web applications, but with proper detection, visualization, and input‑filtering techniques developers can mitigate these hidden risks and even use them for legitimate purposes.
DebuggingUnicodedata integrity
0 likes · 6 min read

The article explains how confusing the literal string "null" with a true null value in user registration requests can let invalid accounts slip through validation, leading to downstream errors and highlighting the need for proper input checks.
JSONinput validationnull bug
0 likes · 3 min read

The article explains how treating the literal string "null" as a valid username can cause user‑experience glitches, log‑analysis confusion, database contamination, security risks, and script failures, and provides step‑by‑step validation, front‑end checks, database constraints, and logging strategies to avoid these hidden bugs.
Securitybackend developmentdatabase integrity
0 likes · 5 min read

This article explains the security hazards of invoking PHP methods directly from user input, illustrates real‑world exploits such as accidental deletions and exposure of debug functions, and provides a concrete allow‑list mapping solution with code examples and best‑practice tips.
Securityallowlistdynamic-method-call
0 likes · 6 min read

Discover how treating the literal string "null" as a legitimate username can cause hidden bugs across frontend validation, backend logic, database integrity, and security, and learn practical code snippets and defensive strategies to detect and prevent these pitfalls.
BackendJavainput validation
0 likes · 5 min read

This article explains the fundamentals of Cross‑Site Scripting attacks, illustrates reflected, stored, and DOM‑based variants with concrete code examples, and presents a four‑step defense strategy—including input validation, output encoding, Content Security Policy, and WAF—to protect web applications.
Content Security PolicyWAFWeb Security
0 likes · 9 min read

The article explains how treating the literal string "null" as an empty value can cause serious bugs in Java backend registration, demonstrates the issue with code examples, and provides practical input‑sanitizing and validation techniques to prevent such errors and related security risks.
NULL handlinginput validation
0 likes · 7 min read

Cross‑Site Scripting (XSS) is a common web security vulnerability where malicious scripts are injected into pages, and this article explains typical PHP XSS scenarios, demonstrates code examples, and outlines effective mitigation techniques such as htmlspecialchars(), HTML Purifier, proper headers, secure cookies, CSP, and best practices.
Content Security PolicyPHPWeb Security
0 likes · 5 min read

This article presents a thorough guide to securing PHP applications by managing Composer dependencies, hardening session handling, implementing CSRF defenses, sanitizing all inputs, enforcing strict type declarations, using prepared statements for database access, concealing sensitive error details, encapsulating critical operations, and incorporating security‑focused testing.
Best PracticesCSRFPHP
0 likes · 16 min read

This article explains the fundamentals of SQL injection attacks, demonstrates step‑by‑step exploitation using the DVWA platform—including data extraction, login bypass, and injection point detection—and outlines practical prevention techniques such as input validation, regex filtering, and prepared statements.
DVWAMySQLSQL injection
0 likes · 11 min read

This guide reveals nine frequent security mistakes in Node.js applications—from misconfigured CORS and vulnerable dependencies to weak authentication and missing HTTPS—offering concrete code‑level solutions and best‑practice recommendations to protect your backend.
AuthenticationCORSDependency Management
0 likes · 8 min read

This guide explains how to use Laravel 11's alpha, alpha_num, and alpha_dash validation rules to restrict input fields to specific characters, and provides complete code examples for each rule in a controller.
PHPalpha_rulebackend development
0 likes · 5 min read

This article explains defensive programming as a proactive coding paradigm that anticipates and mitigates errors through input validation, error handling, assertions, and continuous testing, and demonstrates its application with detailed Java examples covering pagination, loop safety, exception management, and boundary checks.
JavaSoftware Robustnessdefensive programming
0 likes · 15 min read

This article walks through building a classic number‑guessing game in Python, presenting two community‑sourced solutions, detailed code snippets, explanations of the while‑loop and random modules, and enhancements for input validation and interactive range feedback, helping readers deepen their programming fundamentals.
Number Guessing GamePythoninput validation
0 likes · 6 min read

This article examines frequent security and quality pitfalls in PHP development—such as deprecated functions, SQL injection, XSS, insecure file inclusion, poor error handling, session hijacking, hard‑coded credentials, insufficient input validation, outdated versions, and low code quality—and provides concrete best‑practice recommendations to avoid them.
PHPSecuritycode quality
0 likes · 8 min read

Defensive programming is a proactive coding paradigm that anticipates errors and exceptions, emphasizing input validation, error isolation, assertions, thorough testing, and clear error handling, with practical examples ranging from pagination parameter checks to loop safeguards, illustrating how to enhance software robustness and stability.
JavaSoftware Robustnessdefensive programming
0 likes · 16 min read

This article provides a comprehensive overview of web security, covering authentication, input validation, secure coding practices, SQL injection and XSS attack mechanisms, detection methods, defensive techniques, and best practices for secure file upload and download.
File UploadSQL injectionWeb Security
0 likes · 15 min read

This article explains why PHP security is critical and outlines five common PHP vulnerabilities—SQL injection, XSS, CSRF, remote code execution, and file inclusion—along with comprehensive best‑practice recommendations such as input validation, secure password storage, session management, error handling, and continuous learning.
Best PracticesVulnerabilitiesinput validation
0 likes · 18 min read

This article explores Python's callable() function, explaining its purpose, principles, and practical applications through detailed code examples, helping readers master this essential tool for understanding Python's object-oriented and functional programming features.
Code ExamplesPythoncallable function
0 likes · 4 min read

This article outlines six practical techniques—input validation, leveraging Go's secure standard library, avoiding concurrency pitfalls, using defer for resource cleanup, rigorous error checking, and employing context for timeouts—to help developers write more secure and reliable Go applications.
ContextGoinput validation
0 likes · 6 min read


21CTOApr 16, 2024 · Backend Development
Backend development underpins every software application, and mastering practices such as input validation, robust error handling, separation of concerns, and thorough testing and documentation ensures applications are secure, maintainable, and scalable, empowering developers to build resilient server‑side systems.
Best PracticesSeparation of Concernsbackend development
0 likes · 6 min read

This article explains the principles, provides code examples, and outlines preventive measures for LDAP and SQL injection attacks in PHP, helping developers understand how these vulnerabilities work and how to secure their web applications through input validation, parameter binding, and access control.
LDAP injectionSQL injectionWeb Security
0 likes · 6 min read

This article explains what Cross‑Site Scripting (XSS) is, describes its various types and the severe threats it poses, and provides comprehensive defense techniques—including input/output validation, HTML/JavaScript encoding, HttpOnly cookies, and secure handling of URLs, CSS, and rich‑text content—to protect web applications from XSS attacks.
CSRFHTML EncodingWeb Security
0 likes · 31 min read

This article explains how to secure PHP APIs by implementing a signature mechanism and rate‑limiting using Redis, and also outlines additional protections such as HTTPS, access control, input validation, logging, and security audits.
API SecurityHTTPSPHP
0 likes · 6 min read

This article explains common security risks of file uploads in web applications and provides PHP code examples for MIME type validation, extension checking, size limits, filename sanitization, directory permission settings, and safe renaming to mitigate attacks.
File UploadPHPinput validation
0 likes · 5 min read

This article explains how to secure PHP web applications by performing code reviews, validating user input, preventing SQL injection and XSS, and using security testing tools such as PHP Security Scanner, OWASP ZAP, and Kali Linux, along with practical testing methods like boundary, authorization, and exception handling.
PHPXSScode review
0 likes · 5 min read

This article outlines key PHP security techniques—including input validation, dangerous character filtering, XSS mitigation, HttpOnly cookies, prepared statements, and session hardening—providing code examples to help developers safeguard their web applications against common attacks.
PHPSession ManagementXSS
0 likes · 5 min read

The article outlines practical coding habits—thorough input validation, comprehensive logging, careful RPC handling, batch processing, cautious SQL execution, safe extensions, disciplined refactoring, minimal dependencies, data consistency, and avoiding over‑engineering—to help engineers write reliable, maintainable code.
Data ConsistencyLoggingRPC
0 likes · 9 min read

This article introduces PHP security library functions such as htmlspecialchars(), htmlentities(), and mysqli_real_escape_string(), demonstrating with code examples how they filter and validate user input to prevent XSS and SQL injection attacks, while noting that additional security measures are still required.
PHPSQL injectionSecurity
0 likes · 4 min read

This article documents a step‑by‑step solution for preventing XSS attacks in a Spring Boot application, covering input validation, a custom HttpServletRequestWrapper, filter registration, and Jackson serializers/deserializers to escape malicious HTML both on request parameters and JSON payloads.
JacksonRequestWrapperSecurity
0 likes · 16 min read

This article explains how to enhance form usability in Flutter by using appropriate error prompts, label styles, keyboard configurations, and validation rules, providing practical code examples and best‑practice recommendations for building consistent, user‑friendly form components in mobile applications.
FlutterForm UXinput validation
0 likes · 10 min read

A PHP input‑validation flaw (CVE‑2022‑31629) in several versions lets attackers inject malicious __Host‑ or __Secure‑ prefixed cookies, which the application may accept and act upon, and the issue can be mitigated by upgrading to patched PHP releases.
Cookie InjectionSecuritycve-2022-31629
0 likes · 2 min read

This guide explains how to design user‑friendly form editors by covering form fundamentals, layout options, input control properties, validation methods, interaction feedback, and advanced components such as date pickers, file uploads, and grouping, helping developers create efficient, adaptable forms for various scenarios.
User Experienceform designfrontend UI
0 likes · 12 min read

The article explains how to enforce a custom length limit in JavaScript input fields that counts English letters and numbers as half a unit, Chinese characters as one unit, and each emoji as one unit, using Unicode code‑point detection, regex extraction, and automatic truncation to prevent overflow.
Front-endJavaScriptLength Calculation
0 likes · 10 min read

The article outlines defensive programming concepts, emphasizing input validation, error handling, resource management, isolation techniques, and design considerations such as thread safety, cache strategies, and interface versioning to build robust and resilient software systems.
Software Robustnessdefensive programmingerror handling
0 likes · 4 min read

This article provides a comprehensive collection of regular expression patterns for validating numbers, characters, emails, URLs, IP addresses, dates, and other common input formats, offering developers ready-to-use solutions for robust data validation in applications.
data validationinput validationregex
0 likes · 15 min read

Writing robust front‑end code involves systematic exception handling, thorough input validation, disciplined code‑style practices such as default cases and optional chaining, careful selection of mature third‑party libraries, and proactive robustness testing like monkey testing to ensure the UI remains functional under unexpected conditions.
Best PracticesJavaScriptRobustness
0 likes · 8 min read

This article compiles a comprehensive collection of regular expression patterns for validating numeric values, character strings, and various special formats such as emails, URLs, phone numbers, dates, IP addresses, and more, providing ready‑to‑use code snippets for developers.
input validationpattern libraryregex
0 likes · 16 min read


21CTOApr 15, 2021 · Information Security
This article presents practical secure coding guidelines—including input escaping, avoiding auto‑increment IDs, minimalist HTTP methods, least‑privilege design, mandatory HTTPS, strong encryption algorithms, and whitelist‑based execution—to help developers embed real‑time security into modern software.
HTTPSSQL injectionencryption
0 likes · 7 min read


21CTOMar 10, 2021 · Information Security
An Apple iCloud account was denied and the user’s ID locked for six months because her surname “true” was mistakenly treated as a Boolean value, highlighting how unescaped input can trigger security mechanisms and the importance of proper string handling in software systems.
SQL injectionbooleaniCloud
0 likes · 5 min read


ITPUBMar 10, 2021 · Information Security
An Apple iCloud applicant named Rachel True was denied service and had her account locked for six months because the system mistakenly treated her surname "true" as a Boolean value, highlighting how improper input handling can trigger security defenses like SQL‑injection protection.
Apple IDSQL injectionboolean
0 likes · 5 min read

This article explains what XSS attacks are, demonstrates simple exploitation scenarios, and provides a comprehensive solution using the mica-xss library with Spring MVC, including dependency setup, request filtering, testing methods, and the underlying Jsoup‑based implementation.
Web SecurityXSSinput validation
0 likes · 7 min read

An extensive compilation of regular expressions covering numeric, character, email, URL, phone, ID, password, date, IP, and other validation patterns, complete with examples and explanations, providing developers a ready reference for implementing robust input validation across various programming contexts.
Backenddatainput validation
0 likes · 5 min read

This article explains what SQL injection is, demonstrates a SQLite example that injects malicious code to drop a table, and then shows how to prevent such attacks using parameterized queries, input validation, and secure coding practices.
Database SecurityParameterized QueriesSQL injection
0 likes · 8 min read


ITPUBJan 16, 2020 · Information Security
This article explains what SQL injection is, demonstrates a vulnerable SQLite example that drops a table using malicious input, shows why the attack works, and provides practical prevention techniques such as using parameterized queries, input validation, unpredictable table names, and regular backups to secure databases.
SQL injectionSQLiteinput validation
0 likes · 8 min read

This guide shows how to reliably collect user input in Python by placing the input call inside a while loop, using continue and break for flow control, handling parsing errors with try/except, and adding custom validation functions for robust data entry.
Loopsfunctionsinput validation
0 likes · 7 min read

This article provides a comprehensive collection of regular expression patterns for validating various numeric formats, character sets, and special input requirements such as email addresses, URLs, phone numbers, IDs, passwords, dates, and IP addresses, with clear examples for each case.
Backendfrontendinput validation
0 likes · 9 min read

This article explains the fundamentals of Cross‑Site Scripting (XSS) attacks, presents real‑world examples, classifies stored, reflected, and DOM‑based XSS, and provides comprehensive prevention, detection, and mitigation techniques for frontend developers, including proper escaping, whitelist schemes, CSP, and secure coding practices.
CSPWeb SecurityXSS
0 likes · 27 min read

This article explains the three main types of XSS attacks, provides concrete examples, outlines common remediation techniques such as proper HTML escaping, and highlights seven practical considerations for functional regression testing and secure server‑side and client‑side handling.
HTML escapingVulnerability TestingWeb Security
0 likes · 7 min read

This comprehensive tutorial explains what XSS is, describes the three main attack types, illustrates how malicious scripts are injected and executed, and provides practical strategies—including encoding, validation, and Content Security Policy—to defend web applications against cross‑site scripting vulnerabilities.
Content Security PolicyCross-site scriptingXSS
0 likes · 28 min read


ITPUBMar 3, 2017 · Information Security
This article explains the mechanics of SQL injection and XSS attacks, demonstrates common exploitation methods such as table‑name guessing, error‑based and union queries, shows a vulnerable authentication script, and provides practical defensive coding techniques to mitigate these threats.
SQL injectionWeb SecurityXSS
0 likes · 10 min read

The article reviews the author’s experience with security testing, explains the severe risks of SQL injection, demonstrates vulnerable server‑side code, and provides practical remediation methods such as input sanitization, type casting, and using prepared statements with PDO.
Database SecurityPDOSQL injection
0 likes · 5 min read


ITPUBJul 12, 2016 · Information Security
This article explains what SQL injection is, shows vulnerable PHP code examples, and provides concrete prevention techniques—including input validation, parameterized queries, limited database privileges, error handling, and proper escaping of special characters—to protect web applications from attacks.
PHPPrepared StatementsSQL injection
0 likes · 5 min read


21CTOFeb 8, 2016 · Fundamentals
This article explains defensive programming concepts for PHP developers, illustrating why anticipating failures, never trusting user input, avoiding assumptions, maintaining narrow focus, and keeping consistent syntax can dramatically reduce bugs and improve code reliability.
Coding Best PracticesPHPdefensive programming
0 likes · 8 min read


21CTOFeb 6, 2016 · Information Security
This guide outlines a comprehensive security checklist covering form input validation, safe system call handling, buffer overflow prevention, strong password policies, session protection, mitigation of XSS, SQL injection, CSRF, Apache and MySQL hardening, PHP configuration, and fuzz testing techniques.
Web Securityapache hardeningbuffer overflow
0 likes · 6 min read

This article explains what Cross‑Site Scripting (XSS) is, distinguishes non‑persistent and persistent attacks with real‑world URL examples, and outlines practical defense strategies such as proper escaping, character‑set handling, and content‑type settings to protect web applications.
Cross-site scriptingDefenseXSS
0 likes · 4 min read

After a rushed fix for a division‑by‑zero bug caused incorrect results, the team learns to validate data at its source, adopt proper validation frameworks, and step back to understand underlying requirements, emphasizing that thoughtful design outweighs quick code patches.
PHPbackend developmentbug fixing
0 likes · 6 min read
