-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
What are the steps to reproduce this issue?
- Activate CBSecurity DB Logger
- Within Testbox, create an integration test that will trigger a cbSecurity rule (e.g.
get( "/api/v1/secure/" );) - Note the exception: "Error Executing Database Query.[Macromedia][SQLServer JDBC Driver][SQLServer]String or binary data would be truncated."
What happens?
The resulting SQL could use values longer than the allocated 255 varchar column length. Here's some sample SQL that could be generated within Testbox. Note the referer column is greater than 255 characters.
INSERT INTO cbsecurity_logs(
id,
logdate,
action,
blocktype,
ip,
host,
httpmethod,
path,
querystring,
referer,
useragent,
userid,
securityrule
)VALUES (
'dabef304-d42c-4dbd-a6cd-819b1ca3b1a6',
2025-12-25 11:26:04.596,
'override',
'authorization',
'127.0.0.1',
'127.0.0.1:60830',
'GET',
'',
'method=runRemote&directory=&testSpecs=CDD465F2506F60710FBB83B2A51FCB5582B4BCDD3099EB8AA58FE02F761A6DB1&testBundles=tests%2Especs%2Eintegration%2EUserRolesTest&opt_run=true&coverageEnabled=false',
'http://127.0.0.1:60830/tests/specs/integration/UserRolesTest.cfc?method=runRemote&directory=&testSpecs=CDD465F2506F60710FBB83B2A51FCB5582B4BCDD3099EB8AA58FE02F761A6DB1&testBundles=tests%2Especs%2Eintegration%2EUserRolesTest&opt_run=true&coverageEnabled=false',
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36',
'7',
'{"permissions":"","whiteList":"","scopes":"admin","secureList":"v1:users"...
What were you expecting to happen?
Expected the log to be written to the DB
Any other comments?
Two ideas for fixing the issue:
- Assign
queryStringandrefererto VARCHAR(max) (orgetTextColumnType()) - Alternatively, trim the string upon entry to the first 255 characters.
What versions are you using?
Package Version: 3.6.0
Metadata
Metadata
Assignees
Labels
No labels