Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing response content validation after performing network operation #26

Open
amazuerar opened this issue Aug 13, 2021 · 0 comments
Open

Comments

@amazuerar
Copy link

Dear Developer!

My name is Alejandro Mazuera-Rozo, I am a PhD Student at Universidad de los Andes, and at Università della Svizzera italiana. I am part of a research on the usage of network libraries within Android apps. As result of this we identified some code locations that might have network related problems.

In this case, we address the code locations that are related to a potential issue concerning a missing validation of the response content against expected values. It would be a good practice to validate whether external server’s responses are correct, use validation rules.

In order to address this issue we recommend you to visit:

  1. https://developer.android.com/training/volley/requestqueue

Potential Code Location missing Response Content validation

  1. When a new request is being added to the Volley queue:

if (!DashHelper.getInstance(this).addRequest(stringRequest)) {

  1. There is no validation when assigning response inside the onResponse() method
    NSStringRequest stringRequest = new NSStringRequest(getApplicationContext(),
    Request.Method.GET, targetURL,
    new Response.Listener<String>() {
    CensusHistory censusResponse = null;
    @Override
    public void onResponse(String response) {
    Persister serializer = new Persister();
    try {
    censusResponse = serializer.read(CensusHistory.class, response);
@amazuerar amazuerar changed the title No Response Content validation Missing response content validation after performing network operation Aug 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant