SlideShare a Scribd company logo
Secure Sharing PHI/PII/PCI data in Andorid Apps Using Content Provider
Content providers helps an application to manage access to data stored by itself, stored by other
apps, and provide a way to share data with other apps. They encapsulate the data, and provide
mechanisms for defining data security. Content providers is a standard interface that connects data
in one process with code running in another process. Implementing a content provider has many
advantages. One of the major advantages is that it helps to share data across applications in a secure
manner.
As per the implementation from google an application data is very private of itself and hence its
not possible for any other application to access this data by default. Content Provider can use
simple insert, update methods to access application data. Content providers offer granular control
over the permissions for accessing data. You can choose to restrict access to a content provider
from solely within your application, grant blanket permission to access data from other
applications, or configure different permissions for reading and writing data
Private Content Provider is the Content Provider which is used only in the single application,
and the safest Content Provider.
Points (Creating a Content Provider):
1. Do not (Cannot) implement Private Content Provider in Android 2.2 (API Level 8) or earlier.
2. Explicitly set the exported attribute to false.
3. Handle the received request data carefully and securely, even though the data comes from the
same application.
4. Sensitive information can be sent since it is sending and receiving all within the same
application.
5. Sensitive information can be sent since the destination provider is in the same application.
6. Handle received result data carefully and securely, even though the data comes from the same
application.
Public Content Provider is the Content Provider which is supposed to be used by unspecified
Points (Creating a Content Provider):
1. Explicitly set the exported attribute to true.
2. Handle the received request data carefully and securely.
3. When returning a result, do not include sensitive information.
4. Do not send sensitive information.
5. When receiving a result, handle the result data carefully and securely.
Attacks on Content Provider can lead to the following vulnerabilities:
1. SQL injections
2. Data leakage
3. Path Traversal
1. SQL Injections:- Protecting against malicious input-
 If the data managed by the content provider is in an SQL database, including external
untrusted data into raw SQL statements can lead to SQL injection. When accessing a content
provider, use parameterized query methods such as query(), update(), and delete() to avoid
potential SQL injection from untrusted sources.
Consider this selection clause:
// Constructs a selection clause by concatenating the user's input to the column name
String mSelectionClause = "var = " + mUserInput;
If you do this, you're allowing the user to concatenate malicious SQL onto your SQL statement.
For example, the user could enter "nothing; DROP TABLE *;" for mUserInput, which would result
in the selection clause var = nothing; DROP TABLE *;. Since the selection clause is treated as an
SQL statement, this might cause the provider to erase all of the tables in the underlying SQLite
database (unless the provider is set up to catch SQL injectionattempts).
To avoid this problem, use a selection clause that uses ? as a replaceable parameter and a separate
array of selection arguments. When you do this, the user input is bound directly to the query rather
than being interpreted as part of an SQL statement. Because it's not treated as SQL, the user input
can't inject malicious SQL. Instead of using concatenation to include the user input, use this
selection clause:
// Constructs a selection clause with a replaceable parameter
String mSelectionClause = "var = ?";
Set up the array of selection arguments like this:
// Defines an array to contain the selection arguments
String[] selectionArgs = {""};
Put a value in the selection arguments array like this:
// Sets the selection argument to the user's input
selectionArgs[0] = mUserInput;
A selection clause that uses ? as a replaceable parameter and an array of selection arguments array
are preferred way to specify a selection, even if the provider isn't based on an SQL database.
2. Data Leakage
Limit the accessibility of an app's sensitive content provider. Use signature permission to
prevent other apps not developed by you from communicating with your app. If you are
using a content provider for sharing data between only your own apps, it is preferable to use
the android:protectionLevel attribute set to “signature” protection. If your content provider is
just for your app’s use then set it to be android:exported=false in the manifest. If you are
intentionally exporting the content provider then you should also specify one or more
permissions for reading and writing.
Path Traversal
By using the canonicalized path, directory traversal will be mitigated even when a doubly-encoded
path is supplied. Applications should ensure that any URL received by a content provider is
canonicalized to avoid a directory traversal attack.
--X-X-X-
Avinash Sinha: - Lead Security Penetration Tester with one of the largest Healthcare company
Having a demonstrated history of working in the information technology and services industry.
Skilled in Penetration Testing, Vulnerability Assessments, Project Management, Health Care, IoT,
Payment Card Industry Data Security Standard (PCI DSS), Linux, HIPPA, FDA, Information
Security, and Integration. Strong Emphasis on Enterprise Security and information technology
with a Corporate-PGDBA focused in International Business from Symbiosis.

More Related Content

What's hot

Custom content provider in android
Custom content provider in androidCustom content provider in android
Custom content provider in androidAly Arman
 
Owasp Top 10 2017
Owasp Top 10 2017Owasp Top 10 2017
Owasp Top 10 2017SamsonMuoki
 
Transient client secret extension
Transient client secret extensionTransient client secret extension
Transient client secret extensionNat Sakimura
 
Iisrt bhanupriya ng (cs)
Iisrt bhanupriya ng (cs)Iisrt bhanupriya ng (cs)
Iisrt bhanupriya ng (cs)IISRT
 
Android Trainning Session 2
Android Trainning  Session 2Android Trainning  Session 2
Android Trainning Session 2Shanmugapriya D
 
Android Training (Content Provider)
Android Training (Content Provider)Android Training (Content Provider)
Android Training (Content Provider)Khaled Anaqwa
 
Android Training Session 1
Android Training Session 1Android Training Session 1
Android Training Session 1Shanmugapriya D
 
Data protection api's in asp dot net
Data protection api's in asp dot netData protection api's in asp dot net
Data protection api's in asp dot netsonia merchant
 
android content providers
android content providersandroid content providers
android content providersDeepa Rani
 
Shaping Tomorrow - Getting Started - Sources
Shaping Tomorrow - Getting Started - SourcesShaping Tomorrow - Getting Started - Sources
Shaping Tomorrow - Getting Started - SourcesKerry Richardson
 
Secure Code Warrior - Robust error checking
Secure Code Warrior - Robust error checkingSecure Code Warrior - Robust error checking
Secure Code Warrior - Robust error checkingSecure Code Warrior
 
Sql injection in cybersecurity
Sql injection in cybersecuritySql injection in cybersecurity
Sql injection in cybersecuritySanad Bhowmik
 
Database and Database Security..
Database and Database Security..Database and Database Security..
Database and Database Security..Rehan Manzoor
 
Attacks on web services need to secure xml on web
Attacks on web services need to secure xml on webAttacks on web services need to secure xml on web
Attacks on web services need to secure xml on webcseij
 

What's hot (20)

Custom content provider in android
Custom content provider in androidCustom content provider in android
Custom content provider in android
 
Owasp Top 10 2017
Owasp Top 10 2017Owasp Top 10 2017
Owasp Top 10 2017
 
Transient client secret extension
Transient client secret extensionTransient client secret extension
Transient client secret extension
 
Iisrt bhanupriya ng (cs)
Iisrt bhanupriya ng (cs)Iisrt bhanupriya ng (cs)
Iisrt bhanupriya ng (cs)
 
Android Trainning Session 2
Android Trainning  Session 2Android Trainning  Session 2
Android Trainning Session 2
 
Web application security
Web application securityWeb application security
Web application security
 
Android Training (Content Provider)
Android Training (Content Provider)Android Training (Content Provider)
Android Training (Content Provider)
 
Ijcet 06 10_005
Ijcet 06 10_005Ijcet 06 10_005
Ijcet 06 10_005
 
Android Training Session 1
Android Training Session 1Android Training Session 1
Android Training Session 1
 
Data protection api's in asp dot net
Data protection api's in asp dot netData protection api's in asp dot net
Data protection api's in asp dot net
 
Sql injection
Sql injectionSql injection
Sql injection
 
Code injection
Code injectionCode injection
Code injection
 
Owasp Top 10
Owasp Top 10Owasp Top 10
Owasp Top 10
 
android content providers
android content providersandroid content providers
android content providers
 
Shaping Tomorrow - Getting Started - Sources
Shaping Tomorrow - Getting Started - SourcesShaping Tomorrow - Getting Started - Sources
Shaping Tomorrow - Getting Started - Sources
 
SQL INJECTION
SQL INJECTIONSQL INJECTION
SQL INJECTION
 
Secure Code Warrior - Robust error checking
Secure Code Warrior - Robust error checkingSecure Code Warrior - Robust error checking
Secure Code Warrior - Robust error checking
 
Sql injection in cybersecurity
Sql injection in cybersecuritySql injection in cybersecurity
Sql injection in cybersecurity
 
Database and Database Security..
Database and Database Security..Database and Database Security..
Database and Database Security..
 
Attacks on web services need to secure xml on web
Attacks on web services need to secure xml on webAttacks on web services need to secure xml on web
Attacks on web services need to secure xml on web
 

Similar to Secure Sharing PHI PCI PII -Android app_Content Provider

iaetsd Shared authority based privacy preserving protocol
iaetsd Shared authority based privacy preserving protocoliaetsd Shared authority based privacy preserving protocol
iaetsd Shared authority based privacy preserving protocolIaetsd Iaetsd
 
A SECURED AUDITING PROTOCOL FOR TRANSFERRING DATA AND PROTECTED DISTRIBUTED S...
A SECURED AUDITING PROTOCOL FOR TRANSFERRING DATA AND PROTECTED DISTRIBUTED S...A SECURED AUDITING PROTOCOL FOR TRANSFERRING DATA AND PROTECTED DISTRIBUTED S...
A SECURED AUDITING PROTOCOL FOR TRANSFERRING DATA AND PROTECTED DISTRIBUTED S...IRJET Journal
 
IRJET - Blockchain-based Public Integrity Verification for Cloud Storage Agai...
IRJET - Blockchain-based Public Integrity Verification for Cloud Storage Agai...IRJET - Blockchain-based Public Integrity Verification for Cloud Storage Agai...
IRJET - Blockchain-based Public Integrity Verification for Cloud Storage Agai...IRJET Journal
 
Detection of Phishing Websites
Detection of Phishing WebsitesDetection of Phishing Websites
Detection of Phishing WebsitesIRJET Journal
 
Security and Protection of Enterprise Data in Cloud: Implementation of Deniab...
Security and Protection of Enterprise Data in Cloud: Implementation of Deniab...Security and Protection of Enterprise Data in Cloud: Implementation of Deniab...
Security and Protection of Enterprise Data in Cloud: Implementation of Deniab...IJERA Editor
 
Design patterns fast track
Design patterns fast trackDesign patterns fast track
Design patterns fast trackBinu Bhasuran
 
Web application development_dos_and_donts
Web application development_dos_and_dontsWeb application development_dos_and_donts
Web application development_dos_and_dontshuynhvanphuc
 
Automation Hub Best practices - Integrating with 3rd Party Applications.pdf
Automation Hub Best practices - Integrating with 3rd Party Applications.pdfAutomation Hub Best practices - Integrating with 3rd Party Applications.pdf
Automation Hub Best practices - Integrating with 3rd Party Applications.pdfCristina Vidu
 
Introduction All research reports begin with an introduction. (.docx
Introduction All research reports begin with an introduction. (.docxIntroduction All research reports begin with an introduction. (.docx
Introduction All research reports begin with an introduction. (.docxvrickens
 
Data Transfer between Activities & Databases
Data Transfer between Activities & DatabasesData Transfer between Activities & Databases
Data Transfer between Activities & DatabasesMuhammad Sajid
 
Appreciative Advanced Blind SQLI Attack
Appreciative Advanced Blind SQLI AttackAppreciative Advanced Blind SQLI Attack
Appreciative Advanced Blind SQLI Attackijtsrd
 
Best Security Practices for Web Application Development.pdf
Best Security Practices for Web Application Development.pdfBest Security Practices for Web Application Development.pdf
Best Security Practices for Web Application Development.pdfDigital Auxilio Technologies
 
Ijeee 51-57-preventing sql injection attacks in web application
Ijeee 51-57-preventing sql injection attacks in web applicationIjeee 51-57-preventing sql injection attacks in web application
Ijeee 51-57-preventing sql injection attacks in web applicationKumar Goud
 
Content provider in_android
Content provider in_androidContent provider in_android
Content provider in_androidPRITI TELMORE
 
A security note for web developers
A security note for web developersA security note for web developers
A security note for web developersJohn Ombagi
 
IRJET- Enabling Identity-Based Integrity Auditing and Data Sharing with Sensi...
IRJET- Enabling Identity-Based Integrity Auditing and Data Sharing with Sensi...IRJET- Enabling Identity-Based Integrity Auditing and Data Sharing with Sensi...
IRJET- Enabling Identity-Based Integrity Auditing and Data Sharing with Sensi...IRJET Journal
 
Bug Bounty Guide Tools and Resource.pdf
Bug Bounty Guide Tools and Resource.pdfBug Bounty Guide Tools and Resource.pdf
Bug Bounty Guide Tools and Resource.pdfhacktube5
 
A5: Security Misconfiguration
A5: Security Misconfiguration A5: Security Misconfiguration
A5: Security Misconfiguration Tariq Islam
 

Similar to Secure Sharing PHI PCI PII -Android app_Content Provider (20)

Nii sample pt_report
Nii sample pt_reportNii sample pt_report
Nii sample pt_report
 
iaetsd Shared authority based privacy preserving protocol
iaetsd Shared authority based privacy preserving protocoliaetsd Shared authority based privacy preserving protocol
iaetsd Shared authority based privacy preserving protocol
 
A SECURED AUDITING PROTOCOL FOR TRANSFERRING DATA AND PROTECTED DISTRIBUTED S...
A SECURED AUDITING PROTOCOL FOR TRANSFERRING DATA AND PROTECTED DISTRIBUTED S...A SECURED AUDITING PROTOCOL FOR TRANSFERRING DATA AND PROTECTED DISTRIBUTED S...
A SECURED AUDITING PROTOCOL FOR TRANSFERRING DATA AND PROTECTED DISTRIBUTED S...
 
IRJET - Blockchain-based Public Integrity Verification for Cloud Storage Agai...
IRJET - Blockchain-based Public Integrity Verification for Cloud Storage Agai...IRJET - Blockchain-based Public Integrity Verification for Cloud Storage Agai...
IRJET - Blockchain-based Public Integrity Verification for Cloud Storage Agai...
 
Detection of Phishing Websites
Detection of Phishing WebsitesDetection of Phishing Websites
Detection of Phishing Websites
 
Security and Protection of Enterprise Data in Cloud: Implementation of Deniab...
Security and Protection of Enterprise Data in Cloud: Implementation of Deniab...Security and Protection of Enterprise Data in Cloud: Implementation of Deniab...
Security and Protection of Enterprise Data in Cloud: Implementation of Deniab...
 
Design patterns fast track
Design patterns fast trackDesign patterns fast track
Design patterns fast track
 
Web application development_dos_and_donts
Web application development_dos_and_dontsWeb application development_dos_and_donts
Web application development_dos_and_donts
 
Automation Hub Best practices - Integrating with 3rd Party Applications.pdf
Automation Hub Best practices - Integrating with 3rd Party Applications.pdfAutomation Hub Best practices - Integrating with 3rd Party Applications.pdf
Automation Hub Best practices - Integrating with 3rd Party Applications.pdf
 
Introduction All research reports begin with an introduction. (.docx
Introduction All research reports begin with an introduction. (.docxIntroduction All research reports begin with an introduction. (.docx
Introduction All research reports begin with an introduction. (.docx
 
Data Transfer between Activities & Databases
Data Transfer between Activities & DatabasesData Transfer between Activities & Databases
Data Transfer between Activities & Databases
 
Appreciative Advanced Blind SQLI Attack
Appreciative Advanced Blind SQLI AttackAppreciative Advanced Blind SQLI Attack
Appreciative Advanced Blind SQLI Attack
 
Best Security Practices for Web Application Development.pdf
Best Security Practices for Web Application Development.pdfBest Security Practices for Web Application Development.pdf
Best Security Practices for Web Application Development.pdf
 
Ijeee 51-57-preventing sql injection attacks in web application
Ijeee 51-57-preventing sql injection attacks in web applicationIjeee 51-57-preventing sql injection attacks in web application
Ijeee 51-57-preventing sql injection attacks in web application
 
Security Awareness
Security AwarenessSecurity Awareness
Security Awareness
 
Content provider in_android
Content provider in_androidContent provider in_android
Content provider in_android
 
A security note for web developers
A security note for web developersA security note for web developers
A security note for web developers
 
IRJET- Enabling Identity-Based Integrity Auditing and Data Sharing with Sensi...
IRJET- Enabling Identity-Based Integrity Auditing and Data Sharing with Sensi...IRJET- Enabling Identity-Based Integrity Auditing and Data Sharing with Sensi...
IRJET- Enabling Identity-Based Integrity Auditing and Data Sharing with Sensi...
 
Bug Bounty Guide Tools and Resource.pdf
Bug Bounty Guide Tools and Resource.pdfBug Bounty Guide Tools and Resource.pdf
Bug Bounty Guide Tools and Resource.pdf
 
A5: Security Misconfiguration
A5: Security Misconfiguration A5: Security Misconfiguration
A5: Security Misconfiguration
 

Recently uploaded

UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyJohn Staveley
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...CzechDreamin
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationZilliz
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCzechDreamin
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsPaul Groth
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsExpeed Software
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...Sri Ambati
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka DoktorováCzechDreamin
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutesconfluent
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...Product School
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...Elena Simperl
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Product School
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityScyllaDB
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2DianaGray10
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...CzechDreamin
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeCzechDreamin
 

Recently uploaded (20)

UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Introduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG EvaluationIntroduction to Open Source RAG and RAG Evaluation
Introduction to Open Source RAG and RAG Evaluation
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 

Secure Sharing PHI PCI PII -Android app_Content Provider

  • 1. Secure Sharing PHI/PII/PCI data in Andorid Apps Using Content Provider Content providers helps an application to manage access to data stored by itself, stored by other apps, and provide a way to share data with other apps. They encapsulate the data, and provide mechanisms for defining data security. Content providers is a standard interface that connects data in one process with code running in another process. Implementing a content provider has many advantages. One of the major advantages is that it helps to share data across applications in a secure manner. As per the implementation from google an application data is very private of itself and hence its not possible for any other application to access this data by default. Content Provider can use simple insert, update methods to access application data. Content providers offer granular control over the permissions for accessing data. You can choose to restrict access to a content provider from solely within your application, grant blanket permission to access data from other applications, or configure different permissions for reading and writing data Private Content Provider is the Content Provider which is used only in the single application, and the safest Content Provider. Points (Creating a Content Provider): 1. Do not (Cannot) implement Private Content Provider in Android 2.2 (API Level 8) or earlier. 2. Explicitly set the exported attribute to false.
  • 2. 3. Handle the received request data carefully and securely, even though the data comes from the same application. 4. Sensitive information can be sent since it is sending and receiving all within the same application. 5. Sensitive information can be sent since the destination provider is in the same application. 6. Handle received result data carefully and securely, even though the data comes from the same application. Public Content Provider is the Content Provider which is supposed to be used by unspecified Points (Creating a Content Provider): 1. Explicitly set the exported attribute to true. 2. Handle the received request data carefully and securely. 3. When returning a result, do not include sensitive information. 4. Do not send sensitive information. 5. When receiving a result, handle the result data carefully and securely. Attacks on Content Provider can lead to the following vulnerabilities: 1. SQL injections 2. Data leakage 3. Path Traversal 1. SQL Injections:- Protecting against malicious input-  If the data managed by the content provider is in an SQL database, including external untrusted data into raw SQL statements can lead to SQL injection. When accessing a content provider, use parameterized query methods such as query(), update(), and delete() to avoid potential SQL injection from untrusted sources.
  • 3. Consider this selection clause: // Constructs a selection clause by concatenating the user's input to the column name String mSelectionClause = "var = " + mUserInput; If you do this, you're allowing the user to concatenate malicious SQL onto your SQL statement. For example, the user could enter "nothing; DROP TABLE *;" for mUserInput, which would result in the selection clause var = nothing; DROP TABLE *;. Since the selection clause is treated as an SQL statement, this might cause the provider to erase all of the tables in the underlying SQLite database (unless the provider is set up to catch SQL injectionattempts). To avoid this problem, use a selection clause that uses ? as a replaceable parameter and a separate array of selection arguments. When you do this, the user input is bound directly to the query rather than being interpreted as part of an SQL statement. Because it's not treated as SQL, the user input can't inject malicious SQL. Instead of using concatenation to include the user input, use this selection clause: // Constructs a selection clause with a replaceable parameter String mSelectionClause = "var = ?"; Set up the array of selection arguments like this: // Defines an array to contain the selection arguments String[] selectionArgs = {""}; Put a value in the selection arguments array like this: // Sets the selection argument to the user's input selectionArgs[0] = mUserInput; A selection clause that uses ? as a replaceable parameter and an array of selection arguments array are preferred way to specify a selection, even if the provider isn't based on an SQL database. 2. Data Leakage Limit the accessibility of an app's sensitive content provider. Use signature permission to prevent other apps not developed by you from communicating with your app. If you are using a content provider for sharing data between only your own apps, it is preferable to use the android:protectionLevel attribute set to “signature” protection. If your content provider is just for your app’s use then set it to be android:exported=false in the manifest. If you are intentionally exporting the content provider then you should also specify one or more permissions for reading and writing.
  • 4. Path Traversal By using the canonicalized path, directory traversal will be mitigated even when a doubly-encoded path is supplied. Applications should ensure that any URL received by a content provider is canonicalized to avoid a directory traversal attack. --X-X-X- Avinash Sinha: - Lead Security Penetration Tester with one of the largest Healthcare company Having a demonstrated history of working in the information technology and services industry. Skilled in Penetration Testing, Vulnerability Assessments, Project Management, Health Care, IoT, Payment Card Industry Data Security Standard (PCI DSS), Linux, HIPPA, FDA, Information Security, and Integration. Strong Emphasis on Enterprise Security and information technology with a Corporate-PGDBA focused in International Business from Symbiosis.