cwe-359-privacy-violation

Mask PII in Java logs and API responses to remediate CWE-359 vulnerabilities.

3|1|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/DevelopersCoffee/java-cwe-security-skills --skill cwe-359-privacy-violation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cwe-359-privacy-violation
Source: https://github.com/DevelopersCoffee/java-cwe-security-skills/tree/main/cwe-359-privacy-violation
Command: npx skills add https://github.com/DevelopersCoffee/java-cwe-security-skills --skill cwe-359-privacy-violation

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the critical issue of Privacy Violations (CWE-359) in Java applications by identifying and remediating the exposure of Personally Identifiable Information (PII) in logs and API responses.

Core Features & Use Cases

  • PII Detection: Identifies vulnerable patterns where sensitive data like email addresses and Social Security Numbers (SSNs) are logged or returned in API responses.
  • Secure Masking: Implements deterministic fixes to mask PII in logs and selectively expose or mask sensitive fields in API responses.
  • Use Case: When a security audit flags that user SSNs are being logged in plain text, this skill provides the exact code transformation to mask the SSN, leaving only the last four digits visible.

Quick Start

Use the cwe-359-privacy-violation skill to remediate privacy violation vulnerabilities in the provided Java code.

Frequently Asked Questions about cwe-359-privacy-violation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I mask PII like SSNs in Java logs to fix CWE-359 privacy violations?

To fix CWE-359 privacy violations, mask Personally Identifiable Information (PII) in Java logs by applying code transformations that redact sensitive fields, leaving only partial data like the last four digits of an SSN visible.

What is a privacy violation vulnerability in Java applications?

A privacy violation vulnerability occurs when Java applications expose Personally Identifiable Information (PII), such as Social Security Numbers or email addresses, in plain text within logs or API responses during security audits.

How do I remediate SAST findings for sensitive data exposure in API responses?

Remediate SAST findings for sensitive data exposure by implementing secure data handling practices that selectively mask or redact Personally Identifiable Information (PII) returned in Java API responses.

Can I automatically transform Java code to prevent logging sensitive user data?

Yes, you can automatically transform Java code to prevent logging sensitive user data by targeting vulnerable patterns and applying deterministic fixes that mask Personally Identifiable Information (PII) before it reaches application logs.

Does this privacy violation remediation approach work for both logs and API responses?

Yes, this privacy violation remediation approach works for both logs and API responses by identifying vulnerable patterns and implementing secure masking to protect exposed Personally Identifiable Information (PII) across both output channels.