Skip to content

feat: add opencrvs integration#39

Merged
ihtishamtanveer merged 6 commits intodevelopfrom
feat/opencrvs-integration
Jan 20, 2026
Merged

feat: add opencrvs integration#39
ihtishamtanveer merged 6 commits intodevelopfrom
feat/opencrvs-integration

Conversation

@sajclarke
Copy link
Contributor

Description

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Changes Made

Notes

Testing

  • Manual tests completed
  • Added unit tests
  • Added e2e tests

Related Github Issue(s)/Trello Ticket(s)

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Documentation updated

@amazon-inspector-n-virginia
Copy link

⏳ I'm reviewing this pull request for security vulnerabilities and code quality issues. I'll provide an update when I'm done

try {
this.logger.log(`Executing processor: ${config.type}`);
await processor.execute(config.config, context);
const result = await processor.execute(config.config, context);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description: A potential code injection vulnerability has been detected on this line, where untrusted input is passed to a method that may execute arbitrary code. This issue allows attackers to inject and execute arbitrary code within the application, which could lead to unauthorized access to sensitive data or other malicious actions. To mitigate this, ensure that all user-supplied input is properly sanitized and validated before being processed. Avoid passing untrusted input to methods like eval, send, or system that can execute arbitrary code. Where possible, use safer alternatives such as parameterized queries or more controlled methods for handling user input. Learn more

Severity: Critical

submissionId,
data,
});
const processorResults = await this.processorPipeline.execute(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description: A potential code injection vulnerability has been detected on this line, where untrusted input is passed to a method that may execute arbitrary code. This issue allows attackers to inject and execute arbitrary code within the application, which could lead to unauthorized access to sensitive data or other malicious actions. To mitigate this, ensure that all user-supplied input is properly sanitized and validated before being processed. Avoid passing untrusted input to methods like eval, send, or system that can execute arbitrary code. Where possible, use safer alternatives such as parameterized queries or more controlled methods for handling user input. Learn more

Severity: Critical


if (!res.ok) {
const errorText = await res.text();
this.logger.error(`Token request failed: ${res.status} ${errorText}`);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description: User input is being logged without proper sanitization. This creates a security vulnerability where malicious content could be injected through user inputs. To protect your application, always sanitize user data before logging.

Learn more

Severity: High

throw new Error('Create event response missing id');
}

this.logger.log(`Birth event created: ${data.id} (${data.trackingId})`);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description: User input is being logged without proper sanitization. This creates a security vulnerability where malicious content could be injected through user inputs. To protect your application, always sanitize user data before logging.

Learn more

Severity: High


if (!res.ok) {
const errorText = await res.text();
this.logger.error(`Notify event failed: ${res.status} ${errorText}`);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description: User input is being logged without proper sanitization. This creates a security vulnerability where malicious content could be injected through user inputs. To protect your application, always sanitize user data before logging.

Learn more

Severity: High


if (!res.ok) {
const errorText = await res.text();
this.logger.error(`Create event failed: ${res.status} ${errorText}`);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description: User input is being logged without proper sanitization. This creates a security vulnerability where malicious content could be injected through user inputs. To protect your application, always sanitize user data before logging.

Learn more

Severity: High

// Cache the result
this.locationCache.set(cacheKey, match.resource.id);

this.logger.log(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description: User input is being logged without proper sanitization. This creates a security vulnerability where malicious content could be injected through user inputs. To protect your application, always sanitize user data before logging.

Learn more

Severity: High


if (!res.ok) {
const errorText = await res.text();
this.logger.error(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description: User input is being logged without proper sanitization. This creates a security vulnerability where malicious content could be injected through user inputs. To protect your application, always sanitize user data before logging.

Learn more

Severity: High


this.logger.log(`Requesting OpenCRVS access token from: ${url.host}`);

const res = await fetch(url.toString(), {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description: Server-Side Request Forgery (SSRF) vulnerability detected.
Untrusted user input is being used in a network request without proper validation.
This can allow attackers to craft requests to internal systems, access metadata services,
or perform internal port scans. To fix this issue, strictly validate and sanitize the input URL
using a library like node:url for parsing, enforce an allowlist of trusted domains,
and block access to private IP ranges (e.g., 127.0.0.1, 169.254.169.254).
Learn more: https://owasp.org/www-community/attacks/Server_Side_Request_Forgery

Severity: High

@amazon-inspector-n-virginia
Copy link

✅ I finished the code review, and left comments with the issues I found.

"type": "email",
"config": {
"to": "{{formData.email}}",
"to": "testing@govtech.bb",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this intentional? @sajclarke

opencrvs: opencrvsResult.success
? {
success: true,
message: 'Birth registration submitted successfully',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This message is hardcoded for "Birth registration"; if we need to configure opencrvs for another form, the same message will be returned

@ihtishamtanveer ihtishamtanveer merged commit 4ab1178 into develop Jan 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants