Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-default export child_process bug #7

Open
Mickael-van-der-Beek opened this issue Jun 24, 2022 · 3 comments
Open

Non-default export child_process bug #7

Mickael-van-der-Beek opened this issue Jun 24, 2022 · 3 comments
Labels
breakout Issues which bypass Hagana's protection help wanted Extra attention is needed

Comments

@Mickael-van-der-Beek
Copy link

I believe that there is a bug where functions that get extracted from the exports and not from the default export object don't get wrapped by Hagana.

e.g: This works:

import { execSync } from 'child_process';

export function run () {
  const result = execSync('node -v').toString();
  console.log('RESULT=', result);
}

This doesn't:

import childProcess from 'child_process';

export function run () {
  const result = childProcess.execSync('node -v').toString();
  console.log('RESULT=', result);
}
@yaakov123
Copy link
Owner

I'll take a look at this. It should work

@yaakov123
Copy link
Owner

Interesting, I tested for a similar case where I checked if:
const {execSync} = require("child_process")

bypasses the protection (it doesn't), but seems that using import bypasses the protection.

@yaakov123 yaakov123 added help wanted Extra attention is needed breakout Issues which bypass Hagana's protection labels Jun 25, 2022
@yaakov123
Copy link
Owner

This is weird, it's only happening to me occasionally. Do you mind upload a repo with your project structure?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breakout Issues which bypass Hagana's protection help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants