Skip to content
4 changes: 2 additions & 2 deletions box.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name":"ColdBox Security",
"version":"3.7.2",
"version":"3.8.0",
"location":"https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/cbsecurity/@build.version@/cbsecurity-@build.version@.zip",
"author":"Ortus Solutions.com <info@ortussolutions.com>",
"slug":"cbsecurity",
Expand All @@ -24,7 +24,7 @@
],
"dependencies":{
"jwt-cfml":"^1.0.0",
"cbauth":"^6.0.0",
"cbauth":"^7.0.0",
"cbcsrf":"^3.0.0"
},
"devDependencies":{
Expand Down
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Upgraded `cbauth` to `^7.0.0` to support thread-safe authentication startup.

### Fixed

- Corrected the `Strict-Transport-Security` header formatting by removing the extra `": "` in the rendered header value.

## [3.7.2] - 2026-08-26

### 🐛 Fixed
Expand Down
6 changes: 3 additions & 3 deletions interceptors/SecurityHeaders.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,12 @@ component extends="coldbox.system.Interceptor" {
}

if ( variables.settings.securityHeaders.hsts.enabled ) {
var headerValue = "max-age: #variables.settings.securityHeaders.hsts[ "max-age" ]#;";
var headerValue = "max-age=#variables.settings.securityHeaders.hsts[ "max-age" ]#";
if ( variables.settings.securityHeaders.hsts.includeSubDomains ) {
headerValue &= " includeSubDomains";
headerValue &= "; includeSubDomains";
}
if ( variables.settings.securityHeaders.hsts.preload ) {
headerValue &= " preload";
headerValue &= "; preload";
}
event.setHTTPHeader( name: "Strict-Transport-Security", value: headerValue );
}
Expand Down
24 changes: 24 additions & 0 deletions test-harness/tests/specs/integration/CBSecuritySpec.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,30 @@ component extends="coldbox.system.testing.BaseTestCase" appMapping="/root" {
cbauth.logout();
} );

it( "registers the authentication singleton with thread-safe publication", function(){
expect(
getWireBox()
.getBinder()
.getMapping( "authenticationService@cbauth" )
.getThreadSafe()
).toBeTrue();
} );

it( "can log in and out through the cbauth provider", function(){
var security = getInstance( "CBSecurity@cbsecurity" );
var user = getInstance( "User" ).setId( "cbauth-compatibility" );
try {
expect( security.isLoggedIn() ).toBeFalse();
cbauth.login( user );
expect( security.isLoggedIn() ).toBeTrue();
expect( security.getUser().getId() ).toBe( user.getId() );
cbauth.logout();
expect( security.isLoggedIn() ).toBeFalse();
} finally {
cbauth.logout();
}
} );

it( "can retrieve user,auth and mixin services", function(){
var e = get( "/main/cbsecuremixin" );
expect( e.getRenderedContent() ).toBeJSON();
Expand Down
Loading