CWE-359: Exposure of Private Personal Information to an Unauthorized Actor

Description:
The product does not properly prevent a person's private, personal information from being accessed by actors who either (1) are not explicitly authorized to access the information or (2) do not have the implicit consent of the person about whom the information is collected.

Affected languages: Not Language-Specific
Affected technologies: Mobile
Parent weaknesses: CWE-200

Consequences:
  - Confidentiality: Read Application Data

Detection methods:
  - Architecture or Design Review: Private personal data can enter a program in a variety of ways: 
                
                   Directly from the user in the form of a password or personal information 
                   Access
  - Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without havin
  - Automated Static Analysis: Tools are available to analyze documents
	     (such as PDF, Word, etc.) to look for private information
	     such as names, addresses, etc.

Mitigations:
  - [Requirements] Identify and consult all relevant regulations for personal privacy.  An organization may be required to comply with certain federal and state regulations, depending on its location, the type of business it conducts, and the nature of any private data it handles.  Regulations may include Safe Harbor 
  - [Architecture and Design] Carefully evaluate how secure design may interfere with privacy, and vice versa.  Security and privacy concerns often seem to compete with each other. From a security perspective, all important operations should be recorded so that any anomalous activity can later be identified. However, when privat
  - [Implementation] Some tools can automatically analyze
		documents to redact, strip, or "sanitize" private
		information, although some human review might be
		necessary. Tools may vary in terms of which document
		formats can be processed. 
		 
		 
		  When calling an external program to automatically
		  generate o

Demonstrative examples:
The following code contains a logging statement that tracks the contents of records added to a database by storing them in a log file. Among other values that are stored, the getPassword() function returns the user-supplied plaintext password associated with the account.
The code in the example above logs a plaintext password to the filesystem. Although many developers trust the filesystem as a safe storage location for data, it should not be trusted implicitly, particularly when privacy is a concern.
pass = GetPassword(); ... dbmsLog.WriteLine(id + ":" + pass + ":" + type + ":" + tstamp);

This code uses location to determine the user's current US State location.
First the application must declare that it requires the ACCESS_FINE_LOCATION permission in the application's manifest.xml:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
locationClient = new LocationClient(this, this, this); locationClient.connect(); Location userCurrLocation; userCurrLocation = locationClient.getLastLocation(); deriveStateFromCoords(userCurrLocation);

Real-world examples:
  - CVE-2023-29850: Library management product does not strip Exif data from images
  - CVE-2020-26220: Customer relationship management (CRM) product does not strip Exif data from images
  - CVE-2005-0406: Some image editors modify a JPEG image, but the original EXIF thumbnail image is left intact within the JPEG. (Also an interaction error).