nextcloud / nextcloud/updater

Validate response (e.g. status code and content type)

Open
#599 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop bug good first issue
Dominant language
PHP
Stars
51
Forks
40
Avg merge
2d 19h
Merged PRs (30d)
3

Description

https://github.com/nextcloud/updater/blob/e73aa39fff1d3a9ebaf40746a9de093392a5f743/lib/Updater.php#L495-L509

simplexml_load_string expects a well-formed xml document.
We should use curl_getinfo to check for the status code and the content type before parsing it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in lib/Updater.php at lines 495-509 and inspect how the response is passed to simplexml_load_string. Check the available curl_getinfo values for status code and content type, then verify that invalid responses are rejected before XML parsing and valid XML responses still proceed normally.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.