Task
Update velocityjs to >= 2.1.7 in the affected serverless examples to patch a critical prototype pollution vulnerability. This is a focused dependency-only change — no logic changes required.
Vulnerability
| Advisory |
Severity |
Description |
| GHSA-xxxx-velocityjs |
Critical |
Prototype pollution via template rendering, allowing property injection on Object.prototype |
Open Dependabot alerts: 6 (4 critical, 2 high)
Affected Examples
velocityjs is used by amplify-appsync-simulator or serverless-appsync-simulator to render Apache Velocity Template Language (VTL) resolvers locally.
| Example |
Path |
examples/serverless-cognito-local |
package-lock.json |
examples/serverless-localstack-with-s3-and-dynamodb |
pnpm-lock.yaml |
examples/serverless-node-typescript-bundle |
package-lock.json |
examples/serverless-node-typescript-middy-custom-middleware |
package-lock.json |
Steps
- Fork this repository
- For each affected example, check the current version:
cd examples/<example>
npm ls velocityjs
- If
velocityjs is a direct dependency, update it:
npm install velocityjs@^2.1.7 --save
- If it is only a transitive dependency, add an npm override:
// package.json
"overrides": {
"velocityjs": "^2.1.7"
}
For pnpm:
"pnpm": {
"overrides": {
"velocityjs": "^2.1.7"
}
}
- Run
npm install (or pnpm install) and verify the lock file updated
- Test the local simulator still works (if applicable):
npx sls offline start --noPrependStageInUrl
- Open a PR with just the lock file / package.json changes
Validation
cd examples/<affected-example>
npm ls velocityjs # should show >= 2.1.7
npm audit | grep velocity # should return 0 vulnerabilities
Out of Scope
- Do not change VTL template files or resolver code
- Do not update unrelated packages
- Do not migrate to Serverless v4 in this PR (tracked separately)
References
Task
Update
velocityjsto>= 2.1.7in the affected serverless examples to patch a critical prototype pollution vulnerability. This is a focused dependency-only change — no logic changes required.Vulnerability
Object.prototypeOpen Dependabot alerts: 6 (4 critical, 2 high)
Affected Examples
velocityjsis used byamplify-appsync-simulatororserverless-appsync-simulatorto render Apache Velocity Template Language (VTL) resolvers locally.examples/serverless-cognito-localpackage-lock.jsonexamples/serverless-localstack-with-s3-and-dynamodbpnpm-lock.yamlexamples/serverless-node-typescript-bundlepackage-lock.jsonexamples/serverless-node-typescript-middy-custom-middlewarepackage-lock.jsonSteps
velocityjsis a direct dependency, update it:npm install(orpnpm install) and verify the lock file updatedValidation
Out of Scope
References