Skip to content
New issue

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

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

Already on GitHub? # to your account

Patch R 4.0.0 - R 4.3.3 for CVE-2024-27322 #219

Merged
merged 2 commits into from
May 17, 2024
Merged

Patch R 4.0.0 - R 4.3.3 for CVE-2024-27322 #219

merged 2 commits into from
May 17, 2024

Conversation

gaborcsardi
Copy link
Contributor

We also update the NEWS file, so by grepping for
'CVE-2024-27322' one can tell if the patched version is installed or not.

We also update the NEWS file, so by grepping for
'CVE-2024-27322' one can tell if the patched version
is installed or not.
@gaborcsardi gaborcsardi requested a review from glin May 15, 2024 14:37
@stevenolen
Copy link
Collaborator

That NEWS change implies that users will need to reinstall all packages in their existing environments -- is that correct?

@gaborcsardi
Copy link
Contributor Author

gaborcsardi commented May 16, 2024

That NEWS change implies that users will need to reinstall all packages in their existing environments -- is that correct?

No, no need to reinstall packages. What you see above is not our patch, it is the regular R NEWS, and what they mean is that if you installed packages for earlier versions of R (i.e. 3.6.x or earlier in this case), you cannot use those with R 4.0.0.

But sensible people install packages into libraries that are specific for a certain (minor) R version, so in practice no need to reinstall anything.

@stevenolen
Copy link
Collaborator

But sensible people install packages into libraries that are specific for a certain (minor) R version, so in practice no need to reinstall anything.

Ah, yes. Definitely a standard expectation for us.

At install time the other NEWS files will be
re-generated from NEWS.Rd.

To check if your R version is patched, search for
'CVE-2024-27322' in the NEWS. From the command line:
```
grep -C 5 CVE-2024-27322 /opt/R/4.0.0/lib/R/doc/NEWS
```

From R:
```
options(browser = "false")
news(grepl("CVE-2024-27322", Text))
```
@gaborcsardi
Copy link
Contributor Author

gaborcsardi commented May 17, 2024

@glin OK, this should be better now. All the other NEWS files (NEWS, NEWS.pdf, NEWS.html) are re-generated at install time, so we don't patch those.

To check if your R version is patched, search for CVE-2024-27322' in the NEWS.

From the command line:

grep -C 5 CVE-2024-27322 /opt/R/4.0.0/lib/R/doc/NEWS
  CHANGES IN POSIT'S BUILD FROM <URL:
  https://github.com/rstudio/r-builds>:

    * readRDS() and unserialize() now signal an error instead of
      returning a PROMSXP, to fix CVE-2024-27322.

  SIGNIFICANT USER-VISIBLE CHANGES:

    * Packages need to be (re-)installed under this version (4.0.0) of
      R.

From R:

options(browser = "false")
news(grepl("CVE-2024-27322", Text))
                        Changes in version 4.0.0                        

CHANGES IN POSIT'S BUILD FROM <URL:

    o   readRDS() and unserialize() now signal an error instead of
        returning a PROMSXP, to fix CVE-2024-27322.

(I am not sure why the URL does not show up in R, probably an R bug.)

Copy link
Contributor

@glin glin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for taking care of this.

@glin
Copy link
Contributor

glin commented May 17, 2024

@gaborcsardi Yeah it seems like an R bug. At least with 4.3.3, the URL shows up correctly:

> options(browser = "false")
> news(grepl("CVE-2024-27322", Text))

                        Changes in version 4.3.3                        

CHANGES IN POSIT'S BUILD FROM <https://github.com/rstudio/r-builds>

    o   readRDS() and unserialize() now signal an error instead of
	returning a PROMSXP, to fix CVE-2024-27322.

@edavidaja edavidaja linked an issue May 17, 2024 that may be closed by this pull request
@glin glin merged commit 4cbb798 into main May 17, 2024
171 checks passed
@glin glin deleted the fix/CVE-2024-27322 branch May 20, 2024 23:06
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Patching older versions of R for CVE-2024-27322
3 participants