Warning: Always store timestamps in UTC. Convert to user's TZ only at presentation layer.
Strategy
Notes
UTC in API
Suffix Z in ISO 8601
Include offset
2026-05-15T10:30:00-05:00
IANA TZ name
"timezone": "America/New_York" (separate field)
Avoid
Local time without offset, abbreviations (EST, PST)
6. Sanitizing User Input
Threat
Mitigation
XSS
HTML-escape before rendering; use CSP
SQL Injection
Parameterized queries / ORMs
NoSQL Injection
Validate object shapes; reject operators
Command Injection
Whitelist; never pass to shell
Path Traversal
Reject ../, canonicalize paths
Mass Assignment
Allowlist fields (DTO pattern)
7. Implementing Case Conversion
Conversion
Use
snake_case ↔ camelCase
Java backend ↔ JS frontend
Jackson PropertyNamingStrategy.SNAKE_CASE
Auto-convert Java fields
JSON.parse with reviver
JS-side conversion
8. Removing Sensitive Fields
Field
Action
Password hashes
Never serialize (Jackson @JsonIgnore)
Internal IDs
Strip in DTOs
PII (SSN, DOB)
Mask or omit per role
Tokens / secrets
Never log or return
Example: Field-Level Filtering (Java/Jackson)
public class User { private Long id; private String email; @JsonIgnore private String passwordHash; @JsonProperty(access = Access.WRITE_ONLY) private String currentPassword;}