Skip to content

ASLR (pie) disabled in v12 Linux amd64 build from nodejs.org #33425

Closed

Description

@johnandersen777
$ pwn checksec ./node/node-v12.16.3-linux-x64/bin/node
[*] '/home/pdxjohnny/Downloads/node/node-v12.16.3-linux-x64/bin/node'
    Arch:     amd64-64-little
    RELRO:    Full RELRO
    Stack:    Canary found
    NX:       NX enabled
    PIE:      No PIE (0x400000)  # <---- ASLR disabled

I see there was some discussion on this back in 2016, but I couldn't really follow, it also looks like -pie still exists in some of the build files. Just wanted to report in case it's off by mistake.

Activity

  1. added
    buildIssues and PRs related to Node.js builds or CI infrastructure.
    on May 15, 2020
  2. changed the title [-]ALSR (pie) disabled in v12 Linux amd64 build from nodejs.org[/-] [+]ASLR (pie) disabled in v12 Linux amd64 build from nodejs.org[/+] on May 16, 2020
  3. bnoordhuis commented on May 16, 2020

    @bnoordhuis
    Member

    I can't find the issue but I remember it having been discussed. IIRC, the conclusion was to keep PIE disabled because of the sizable performance hit. It was something like 5 or 10%.

    PIE is enabled on macos but that's not a performance-critical platform like linux is. People don't run production servers on their macbooks. (I hope.)

  4. johnandersen777 commented on May 16, 2020

    @johnandersen777
    Author

    Lol, ya let's hope. I saw some comments that talked about performance when I went digging through previous PRs and pull requests but I don't remember seeing anywhere where it was decided definitively to disable because of any specific reasoning. If figured if it was intentional then this issue could just be closed and become an easy place to point to with the definitive response. And if it wasn't intentional then it'll get switched on.

  5. bnoordhuis commented on May 20, 2020

    @bnoordhuis
    Member

    I think the big blocker was ia32/i386: position-independent code is expensive on that architecture because it's register starved.

    But we dropped support for ia32 and x64/amd64/x86_64 doesn't have that problem (rip-relative addressing and plenty of registers) so we could turn on PIE if someone is willing to investigate the performance impact.

    edit: comparing the benchmark/ benchmark numbers would be a good start. Light testing of native modules (add-ons) would be good too, to check if there are no compatibility issues.

  6. added
    feature requestIssues requesting new Node.js features.
    good first issueIssues that are suitable for first-time contributors.
    help wantedIssues that need assistance from volunteers or PRs that need help to proceed.
    on May 20, 2020
  7. woodfairy commented on Oct 18, 2020

    @woodfairy
    Contributor

    Hey, is this still available to work on?

  8. woodfairy commented on Oct 18, 2020

    @woodfairy
    Contributor

    PIE is enabled on macos but that's not a performance-critical platform like linux is. People don't run production servers on their macbooks. (I hope.)

    Bildschirmfoto 2020-10-18 um 20 31 16

    I compiled Node based on the Markdown file instructions and then checked the flags with otool -hv. But there is no PIE flag set, neither under my freshly compiled binary, nor under the binary saved via the official macOS installer. Did I miss something here, because you said that PIE is enabled under macOS?

  9. woodfairy commented on Oct 18, 2020

    @woodfairy
    Contributor

    I have now run some benchmarks with PIE enabled and disabled. As @bnoordhuis already mentioned, you can expect a performance penalty of 5-10%. Here are some results as text file:
    nopie_1.txt
    nopie_2.txt
    nopie_3.txt
    pie_1.txt
    pie_2.txt
    pie_3.txt

    Is this too much cost for PIE being enabled? I think at least on OS X this can be activated. I will make a pull request which removes the -no_pie flags.

  10. johnandersen777 commented on Feb 17, 2022

    @johnandersen777
    Author

    Should this be closed? The issue was about amd64 on Linux

  11. moved this to Pending Triage in Node.js feature requestson Apr 4, 2022
  12. github-actions commented on Aug 17, 2022

    @github-actions
    Contributor

    There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.

    For more information on how the project manages feature requests, please consult the feature request management document.

  13. added
    staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.
    on Aug 17, 2022
  14. github-actions commented on Sep 17, 2022

    @github-actions
    Contributor

    There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment.

    For more information on how the project manages feature requests, please consult the feature request management document.

  15. moved this from Pending Triage to Stale in Node.js feature requestson Apr 4, 2023
  16. jvoisin commented on Oct 10, 2024

    @jvoisin

    The lack of ASLR on the .text segment of the nodejs binary was exploited by SonarSource recently.

  17. johnandersen777 commented on Oct 11, 2024

    @johnandersen777
    Author

    “feature request” my ass! We all knew this was a vuln waiting to happen!!

    Why is this issue still closed???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildIssues and PRs related to Node.js builds or CI infrastructure.feature requestIssues requesting new Node.js features.good first issueIssues that are suitable for first-time contributors.help wantedIssues that need assistance from volunteers or PRs that need help to proceed.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions