usnistgov / oar-pdr

The NIST Open Access to Research (OAR) Public Data Repository (PDR) system software
11 stars 10 forks source link

LPS: set rel="noopener" to links with target="_blank" #318

Closed RayPlante closed 8 months ago

RayPlante commented 1 year ago

This PR is in response to a security scan of the datacart page serving RPA requests. The scan recommends adding rel="noopener noreferrer" to any <a href="..."> that also has target="_blank". This would apply to any link generated in the PDR angular application.

There are two disadvantages to making this recommended change:

Thus, in response, this PR applies the following changes to templates with links with target="_blank":

I have tested this under oar-docker and confirmed that the new attribute appears and that the links still work.

RayPlante commented 1 year ago

This was tested on testdata in the context of RPA and was scanned by AppScan.

chuanlin2018 commented 1 year ago

Sorry I forgot about this PR. Should I merge it?