PHPackages                             mosaxiv/cakephp-secure-target-blank - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. mosaxiv/cakephp-secure-target-blank

ActiveCakephp-plugin[Security](/categories/security)

mosaxiv/cakephp-secure-target-blank
===================================

Adds noopener and noreferrer to target \_blank in Html Helper.

1.0.2(8y ago)29MITPHP

Since Dec 16Pushed 8y ago1 watchersCompare

[ Source](https://github.com/mosaxiv/cakephp-secure-target-blank)[ Packagist](https://packagist.org/packages/mosaxiv/cakephp-secure-target-blank)[ Docs](https://github.com/mosaxiv/cakephp-secure-target-blank)[ RSS](/packages/mosaxiv-cakephp-secure-target-blank/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

SecureTargetBlank plugin for CakePHP
====================================

[](#securetargetblank-plugin-for-cakephp)

[![MIT License](https://camo.githubusercontent.com/db79b92834d905629b1aea42c9aa493da02060189e2af90840b1be5d6bf6ddf7/687474703a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c6174)](LICENSE)[![Build Status](https://camo.githubusercontent.com/24a682b36862a49228b48a8ecd3b267de45a1e90bbfa8f71914201ad4a4206f9/68747470733a2f2f7472617669732d63692e6f72672f6d6f73617869762f63616b657068702d7365637572652d7461726765742d626c616e6b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mosaxiv/cakephp-secure-target-blank)

If you use the `target="_blank"` attribute on a link, you are leaving your users open to a very simple phishing attack. Adding `rel="noopener noreferrer"` on those links will prevent this vulnerability. [Further reading.](https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/)

Requirements
------------

[](#requirements)

- PHP 7.0+
- CakePHP 3.0.0+

Installation
------------

[](#installation)

You can install this plugin into your CakePHP application using [composer](http://getcomposer.org).

The recommended way to install composer packages is:

```
composer require mosaxiv/cakephp-secure-target-blank

```

Usage
-----

[](#usage)

### AppView Setup

[](#appview-setup)

load Helper

```
// src/View/AppView.php

namespace App\View;

use Cake\View\View;
use SecureTargetBlank\View\Helper\HtmlHelper;

class AppView extends View
{
    public function initialize()
    {
        $this->loadHelper('Html', [
            'className' => HtmlHelper::class
        ]);
    }
}
```

### Helper Usage

[](#helper-usage)

Use the `Html->link()` with `[target => "_blank"]`, `rel="noopener noreferrer"` will be added.

#### Basic

[](#basic)

Html Helper:

```
$this->Html->link('test', 'http://example.com', ['target' => '_blank'])
```

will render this HTML:

```
'test'
```

#### `secureBlank` Option

[](#secureblank-option)

Html Helper:

```
$this->Html->link('test_title', ['controller' => 'test'], ['target' => '_blank', 'secureBlank' => false]);
```

will render this HTML:

```
test_title
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

4

Last Release

3113d ago

Major Versions

0.0.1 → 1.0.02017-12-17

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/28671296?v=4)[mosa](/maintainers/mosaxiv)[@mosaxiv](https://github.com/mosaxiv)

---

Top Contributors

[![mosaxiv](https://avatars.githubusercontent.com/u/28671296?v=4)](https://github.com/mosaxiv "mosaxiv (28 commits)")

---

Tags

cakephpcakephp-plugincakephp3phpplugincakephpsecure

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mosaxiv-cakephp-secure-target-blank/health.svg)

```
[![Health](https://phpackages.com/badges/mosaxiv-cakephp-secure-target-blank/health.svg)](https://phpackages.com/packages/mosaxiv-cakephp-secure-target-blank)
```

###  Alternatives

[dereuromark/cakephp-tools

A CakePHP plugin containing lots of useful and reusable tools

333972.2k49](/packages/dereuromark-cakephp-tools)[dereuromark/cakephp-tinyauth

A CakePHP plugin to handle user authentication and authorization the easy way.

131237.3k13](/packages/dereuromark-cakephp-tinyauth)[cakephp/bake

Bake plugin for CakePHP

11211.7M190](/packages/cakephp-bake)[dereuromark/cakephp-setup

A CakePHP plugin containing lots of useful management tools

35184.7k2](/packages/dereuromark-cakephp-setup)[dereuromark/cakephp-shim

A CakePHP plugin to shim applications between major framework versions.

401.1M21](/packages/dereuromark-cakephp-shim)[dereuromark/cakephp-databaselog

A CakePHP plugin for storing and viewing application logs in the database

44170.0k2](/packages/dereuromark-cakephp-databaselog)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
