Skip to content

Commit f801a0c

Browse files
committed
add patched hedera version and fix code security issue
Signed-off-by: Jeromy Cannon <[email protected]>
1 parent 7d96536 commit f801a0c

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

src/commands/node.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { Listr } from 'listr2'
2020
import path from 'path'
2121
import { FullstackTestingError, IllegalArgumentError } from '../core/errors.mjs'
2222
import * as helpers from '../core/helpers.mjs'
23-
import { getTmpDir, sleep } from '../core/helpers.mjs'
23+
import { getTmpDir, sleep, validatePath } from '../core/helpers.mjs'
2424
import { constants, Templates } from '../core/index.mjs'
2525
import { BaseCommand } from './base.mjs'
2626
import * as flags from './flags.mjs'
@@ -313,10 +313,11 @@ export class NodeCommand extends BaseCommand {
313313
}
314314

315315
async initializeSetup (config, configManager, k8) {
316+
const cacheDir = validatePath(config.cacheDir)
316317
// compute other config parameters
317318
config.releasePrefix = Templates.prepareReleasePrefix(config.releaseTag)
318-
config.buildZipFile = `${config.cacheDir}/${config.releasePrefix}/build-${config.releaseTag}.zip`
319-
config.keysDir = path.join(config.cacheDir, 'keys')
319+
config.buildZipFile = `${cacheDir}/${config.releasePrefix}/build-${config.releaseTag}.zip`
320+
config.keysDir = path.join(cacheDir, 'keys')
320321
config.stagingDir = Templates.renderStagingDir(configManager, flags)
321322
config.stagingKeysDir = path.join(config.stagingDir, 'keys')
322323

src/core/helpers.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,10 @@ export function backupOldPemKeys (nodeIds, keysDir, curDate = new Date(), dirPre
164164

165165
return backupDir
166166
}
167+
168+
export function validatePath (input) {
169+
if (input.indexOf('\0') !== -1) {
170+
throw new FullstackTestingError(`access denied for path: ${input}`)
171+
}
172+
return input
173+
}

test/e2e/commands/node.test.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ import {
3535
import { sleep } from '../../../src/core/helpers.mjs'
3636

3737
describe.each([
38-
{ releaseTag: 'v0.47.0-alpha.0', keyFormat: constants.KEY_FORMAT_PFX, testName: 'node-cmd-e2e-pfx' },
39-
{ releaseTag: 'v0.47.0-alpha.0', keyFormat: constants.KEY_FORMAT_PEM, testName: 'node-cmd-e2e-pem' }
38+
{ releaseTag: 'v0.49.0-alpha.1', keyFormat: constants.KEY_FORMAT_PFX, testName: 'node-cmd-e2e-pfx' },
39+
{ releaseTag: 'v0.49.0-alpha.1', keyFormat: constants.KEY_FORMAT_PEM, testName: 'node-cmd-e2e-pem' }
4040
])('NodeCommand', (input) => {
4141
const testName = input.testName
4242
const namespace = testName

test/e2e/setup-e2e.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ kind create cluster -n "${SOLO_CLUSTER_NAME}" --image "${KIND_IMAGE}" || exit 1
1313
# Most of the e2e test should bootstrap its own network in its own namespace. However, some tests can use this as a
1414
# shared resource if required.
1515
# **********************************************************************************************************************
16-
# TODO update hedera version for upcoming patch
1716
solo init --namespace "${SOLO_NAMESPACE}" -i node0,node1,node2 -t v0.42.5 -s "${SOLO_CLUSTER_SETUP_NAMESPACE}" --dev || exit 1 # cache args for subsequent commands
1817
solo cluster setup || exit 1
1918
helm list --all-namespaces

test/test_util.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ export function bootstrapNetwork (testName, argv,
193193

194194
it('should succeed with network deploy', async () => {
195195
await networkCmd.deploy(argv)
196-
}, 60000)
196+
}, 120000)
197197

198198
it('should succeed with node setup command', async () => {
199199
expect.assertions(1)

0 commit comments

Comments
 (0)