
Research
Namastex.ai npm Packages Hit with TeamPCP-Style CanisterWorm Malware
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.
@redwoodjs/auth-dbauth-middleware
Advanced tools
import type { TagDescriptor } from '@redwoodjs/web'
import App from './App'
import initDbAuthMiddleware from '@redwoodjs/auth-dbauth-middleware'
import { Document } from './Document'
import { handler as dbAuthHandler } from '$api/src/functions/auth'
import { cookieName } from '$api/src/lib/auth'
import { getCurrentUser } from '$api/src/lib/auth'
interface Props {
css: string[]
meta?: TagDescriptor[]
}
export const registerMiddleware = () => {
// This actually returns [dbAuthMiddleware, '*']
const authMw = initDbAuthMiddleware({
dbAuthHandler,
getCurrentUser,
// cookieName optional
// getRoles optional
// dbAuthUrl? optional
})
return [authMw]
}
export const ServerEntry: React.FC<Props> = ({ css, meta }) => {
return (
<Document css={css} meta={meta}>
<App />
</Document>
)
}
By default the middleware assumes your roles will be in currentUser.roles - either as a string or an array of strings.
For example
// If this is your current user:
{
email: 'user-1@example.com',
id: 'mocked-current-user-1',
roles: 'admin'
}
// In the ServerAuthState
{
cookieHeader: 'session=session_cookie',
currentUser: {
email: 'user-1@example.com',
id: 'mocked-current-user-1',
roles: 'admin' // <-- you sent back 'admin' as string
},
hasError: false,
isAuthenticated: true,
loading: false,
userMetadata: /*..*/
roles: ['admin'] // <-- converted to array
}
You can customise this by passing a custom getRoles function into initDbAuthMiddleware. For example:
const authMw = initDbAuthMiddleware({
dbAuthHandler,
getCurrentUser,
getRoles: (decoded) => {
// Assuming you want to get roles from a property called org
if (decoded.currentUser.org) {
return [decoded.currentUser.org]
} else {
return []
}
},
})
FAQs
Unknown package
The npm package @redwoodjs/auth-dbauth-middleware receives a total of 29 weekly downloads. As such, @redwoodjs/auth-dbauth-middleware popularity was classified as not popular.
We found that @redwoodjs/auth-dbauth-middleware demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.