Menu

#39 ipsec plugin uses insecure temporary file

open-accepted
openl2tpd (19)
5
2012-04-25
2011-11-26
No

From plugins/ipsec.c:

#define IPSEC_SETKEY_FILE "/tmp/openl2tpd-tmp"

and later:

FILE *f = fopen(IPSEC_SETKEY_FILE, "w");

This is insecure code – any user on the local system, that can write to /tmp could create a symlink to any root-owned file and openl2tpd will overwrite the file when preparing input for 'setkey'.

The solution is to use a secure temporary file, e.g. created with mkstemp(), or write the file in a directory only root can write to (e.g. /var/run/openl2tp).

Discussion

  • James Chapman

    James Chapman - 2011-12-05

    Thankyou fo this bug report.

    Could you submit a patch?

     
  • James Chapman

    James Chapman - 2012-04-25

    Thanks for reporting this. We've implemented a fix as suggested for the next release.

     
  • James Chapman

    James Chapman - 2012-04-25
    • status: open --> open-accepted
     

Log in to post a comment.